Skip to content

Instantly share code, notes, and snippets.

@jfcode
Last active November 17, 2016 09:50
Show Gist options
  • Save jfcode/9422947 to your computer and use it in GitHub Desktop.
Save jfcode/9422947 to your computer and use it in GitHub Desktop.
function RemoveAddMediaButtonsForNonAdmins(){
if ( !current_user_can( 'manage_options' ) ) {
remove_action( 'media_buttons', 'media_buttons' );
}
}
add_action('admin_head', 'RemoveAddMediaButtonsForNonAdmins');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment