Skip to content

Instantly share code, notes, and snippets.

Created July 2, 2014 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/cadd3e7238cb391ad6b5 to your computer and use it in GitHub Desktop.
Save anonymous/cadd3e7238cb391ad6b5 to your computer and use it in GitHub Desktop.
function awordpress_load_scripts($hook) {
if( $hook != 'users.php' )
return;
wp_enqueue_script( 'tablesorter', plugins_url( 'js/jquery.tablesorter.js' , dirname(__FILE__) ), array( 'jquery' ) );
wp_enqueue_script( 'custom-js', plugins_url( 'js/custom.js' , dirname(__FILE__) ), array( 'tablesorter' ) );
}
add_action('admin_enqueue_scripts', 'awordpress_load_scripts');
where in the custom.js you should put something like the following
jQuery(document).ready(function($) {
$(".users").tablesorter();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment