I needed to add a metabox to log activities for our team owner but WooCommerce Memberships for teams was giving me a hard time. Turns out they have a whitelist of metaboxes allowed on their post type. This makes sense because WordPress plugins can be terrible for adding metaboxes on every single post type in your whole damn site.
Watch this short video to see how to add your metabox to the array of whitelisted metabox ids for WooCommerce Memberships for Teams.
“`php
/**
* Adds my metabox to the array of allowed metaboxes on the CPT
*
* @param array $allowed required The array of allowed metabox ids
* @return array $allowed The array with my item added in
*/
function allow_my_metabox( $allowed ){
$allowed[] = ‘prov_team_comments’;
return (array) $allowed;
}
add_filter( ‘wc_memberships_for_teams_allowed_meta_box_ids’, ‘allow_my_metabox’ );
“`