Making post views as sortable
The posts_column_register_sortable function, hooked onto posts_column_register_sortable returns an array with names of sortable columns as keys and their corresponding value what to sort by (e.g. ‘post_title’ etc). In your case you’ve given it ‘post_views’ to sort by, which doesn’t exist as a column – so you need to tell WordPress how to sort by it. … Read more