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

Fix column mismatch broken sort #55

Merged

Conversation

bookwyrm
Copy link
Contributor

Fixes #54

The way that WP and this library handle specifying orderby fields is not working well. The orderby clause from WordPress is the actual meta_key that posts should be sorted by, but PostType expects the orderby clause to be the column_key. This works fine until the meta_key and the column_key are different.

This commit makes the check more extensive and supports the actual sort behavior as implemented by WordPress.
Copy link

@unapersona unapersona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested as a patch and works perfectly, thanks!

@jjgrainger
Copy link
Owner

Thank you for this. Approved and merged :)

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

Successfully merging this pull request may close these issues.

Sorting broken when column key and orderby column do not match
3 participants