October 2018
Beginner
300 pages
8h 34m
English
The default list tables provides sorting capabilities for the first column and one or more from the remaining columns. However, these are built-in columns provided by the WordPress core features. So, we need the ability to sort custom column values to effectively use and filter the custom data. WordPress provides a built-in filter for specifying sortable columns. Let's consider the following filter and its implementation:
add_filter('manage_users_sortable_columns', array($this,'users_sortable_columns'));public function users_sortable_columns( $columns ) { $columns['featured_user_status'] = 'featured_user_status'; return $columns;}
The filter needs to be added inside the constructor of the class. This filter accepts ...
Read now
Unlock full access