You can’t pass SQL directly as query parameters. The only valid values for orderby
are covered in the docs for WP_Query
.
If you want to directly modify the SQL, you need to use the posts_*
filters, in this case posts_orderby
.
You can’t pass SQL directly as query parameters. The only valid values for orderby
are covered in the docs for WP_Query
.
If you want to directly modify the SQL, you need to use the posts_*
filters, in this case posts_orderby
.