Created
February 6, 2020 12:30
-
-
Save ckaklamanos/6444e89d281116abdf3efa47efe8768c to your computer and use it in GitHub Desktop.
WP Astra Theme Remove Meta Box per Post Type (for non-Administrators)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fn_remove_astra_metabox_per_post_type() { | |
$post_types = array( | |
//'page', | |
//'product', | |
//'post', | |
); | |
foreach ( $post_types as $key => $post_type ) { | |
remove_meta_box( 'astra_settings_meta_box', $post_type, 'side' ); | |
} | |
} | |
if (!current_user_can('manage_options')) { | |
add_action( 'do_meta_boxes', 'fn_remove_astra_metabox_per_post_type' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment