Skip to content

Instantly share code, notes, and snippets.

@DumahX
Last active April 9, 2021 00:40
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 DumahX/b199158ba53037a60e1c62f92e2fa01f to your computer and use it in GitHub Desktop.
Save DumahX/b199158ba53037a60e1c62f92e2fa01f to your computer and use it in GitHub Desktop.
<?php
function mepr_remove_unauthorized_meta_box() {
if ( ! current_user_can( 'administrator' ) ) {
foreach ( get_post_types() as $post_type ) {
remove_meta_box( 'mepr_unauthorized_message', $post_type, 'advanced' );
}
}
}
add_action( 'admin_head', 'mepr_remove_unauthorized_meta_box' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment