Skip to content

Instantly share code, notes, and snippets.

@georgestephanis
Created February 8, 2014 02:44
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 georgestephanis/8875881 to your computer and use it in GitHub Desktop.
Save georgestephanis/8875881 to your computer and use it in GitHub Desktop.
<?php
add_action( 'admin_menu', 'nuke_jetpack_lowlevel_menu', 900 );
function nuke_jetpack_lowlevel_menu() {
// If Jetpack isn't active, do nothing.
if ( ! class_exists( 'Jetpack' ) ) {
return;
}
// If the user is an author or above, do nothing.
if ( current_user_can( 'publish_posts' ) ) {
return;
}
// Otherwise, remove the bit of code that adds the menu.
remove_action( 'admin_menu', array( Jetpack::init(), 'admin_menu' ) );
// And that which might later
remove_action( 'admin_menu', array( Jetpack_Admin::init(), 'admin_menu' ) );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment