Skip to content

Instantly share code, notes, and snippets.

@scarstens
Created September 29, 2013 16:53
Show Gist options
  • Select an option

  • Save scarstens/6754238 to your computer and use it in GitHub Desktop.

Select an option

Save scarstens/6754238 to your computer and use it in GitHub Desktop.
Script that adds or enqueues javascript to a wp-admin page (a specified page, not all of them)
function my_enqueue($hook) {
if( 'users.php' != $hook && 'user-meta-manager' != $_GET['page'])
return;
wp_enqueue_script( 'jquery-ui-sortable');
}
add_action( 'admin_enqueue_scripts', 'my_enqueue' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment