Created
December 26, 2011 02:29
-
-
Save RalfAlbert/1520418 to your computer and use it in GitHub Desktop.
WordPress - Make posts column sortable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Plugin Name: Sortable post column | |
Description: Make posts column on users screen sortable | |
Version: 0.0.1 | |
Author: Ralf Albert | |
Author URI: http://yoda.neun12.de | |
*/ | |
// make posts-column sortable | |
add_filter( 'manage_users_sortable_columns', 'register_user_post_column_sortable' ); | |
function register_user_post_column_sortable( $columns ){ | |
$columns['posts'] = array( 'post_count', 'desc' ); | |
return $columns; | |
} | |
/* PHP5.3 style */ | |
/* | |
add_filter( 'manage_users_sortable_columns', | |
function( $columns ){ | |
$columns['posts'] = array( 'post_count', 'desc' ); | |
return $columns; | |
} | |
); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment