Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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