Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document difference between orderby query and sort_field filter #6

Open
1 task
eliot-akira opened this issue Nov 12, 2024 · 0 comments
Open
1 task

Comments

@eliot-akira
Copy link
Contributor

eliot-akira commented Nov 12, 2024

From:

Query parameter orderby

The query parameter orderby is supported by the post loop type, which passes it to WP_Query to make a database query.

Similarly, the taxonomy loop type with WP_Term_Query and user loop with WP_User_Query. Each of these is a separate implemenation in WP core with some differences in accepted values.

Generic loop filter sort_field

The generic loop filter sort_field is supported by the base loop, which all loop types are built on.

Any loop type with multiple values, including the result of post queries, can be sorted as long as it's a list of objects with sortable field values (like number, string, date).

  • sort_field, sort_order, and sort_type

They're briefly documented here. https://docs.loopsandlogic.com/dynamic-tags/loop/#attributes-1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant