Custom Sortable Media Library Column
-
I have a plugin that adds a column to the Media Library page, and now I’m trying to make it sortable for 3.1
Rough sketch of what I’m doing:
function myplugin_register_sortable($columns) {…}
add_filter(‘manage_media_sortable_columns’, ‘myplugin_register_sortable’);My function never gets run. (I even tried just die()-ing out of it.)
My research suggests I do have the right filter name, but it’s not being run on upload.php (the media library).Additionally, it’s not clear to me how exactly to actually specify the sorting of the column. The examples I’ve seen use this:
$vars = array_merge( $vars, array(
‘meta_key’ => ‘Views’,
‘orderby’ => ‘meta_value_num’
) );
but never really say what meta_value_num is?Any ideas on either parts? thanks!
- The topic ‘Custom Sortable Media Library Column’ is closed to new replies.