Hide the Astra settings for users who are lower than administrator

Hide the Astra settings for users who are lower than administrator on child sites.

Snippet Type

Execute on Child Sites

Snippet

function ast_remove_plugin_metaboxes(){
    if ( ! current_user_can( 'administrator' ) ) {
        remove_meta_box( 'astra_settings_meta_box', 'page', 'side' ); // Remove Astra Settings in Pages
        remove_meta_box( 'astra_settings_meta_box', 'post', 'side' ); // Remove Astra Settings in Posts
    }
}