Snippets: Only Show Staff Settings in the Theme Settings Metabox when Editing Staff Posts

// Only display the staff settings on the staff post type.
add_filter( 'wpex_metabox_array', function( $settings, $post ) {
    if ( 'staff' === get_post_type( $post ) ) {
        $settings = array(
            $settings['staff'],
        );
    }
    return $settings;
}, 10, 2 );
All PHP snippets should be added via a child theme's functions.php file or via the Code Snippets Plugin (or alternative plugin)