Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ckaklamanos/6444e89d281116abdf3efa47efe8768c to your computer and use it in GitHub Desktop.
Save ckaklamanos/6444e89d281116abdf3efa47efe8768c to your computer and use it in GitHub Desktop.
WP Astra Theme Remove Meta Box per Post Type (for non-Administrators)
<?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