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

Why "Views" Column in back-end is not sortable ? #42

Closed
ArachnidCoder opened this issue Oct 14, 2019 · 2 comments
Closed

Why "Views" Column in back-end is not sortable ? #42

ArachnidCoder opened this issue Oct 14, 2019 · 2 comments

Comments

@ArachnidCoder
Copy link

I don't have the options to sort the views columns on my custom post type.
Should I do something special to enabled it ?

I found the sort_postviews_column function but can't get it working.

Thanks for your help

@lesterchan
Copy link
Owner

lesterchan commented Oct 14, 2019

You will need to add add_filter( 'manage_edit-<CUSTOM_POST_TYPE>_sortable_columns', 'sort_postviews_column' );, see https://codex.wordpress.org/Plugin_API/Filter_Reference/manage_$post_type_sortable_columns

@ArachnidCoder
Copy link
Author

Thanks =)

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

2 participants