sort posts by custom field IN BACKEND
-
hi everyone!
I’m looking for a way to customize the order of the post-list in the admin section to show all posts under “edit posts” ordered by a custom field.
what i know is that the query for that list is in
wp-admin/includes/post.php
in the functionwp_edit_posts_query()
there it tells
wp("post_type=post&$post_status_q&posts_per_page=$posts_per_page&order=$order&orderby=$orderby");
unfortunately it DOESN’T work to change the string to
...orderby=meta_value&meta_key=MyCustomField
the function seems to be unable to pull the metadata, cozorderby=post_title
works…any idea to sort by a custom field or how to pull the metadata into this query?
thanks in advance!
- The topic ‘sort posts by custom field IN BACKEND’ is closed to new replies.