I'm trying to restrict the metaboxes to the front page and there's no reason to create a separate template for the homepage as I would usually. I am calling a custom function as below:
'include' => array(
'custom' => 'cfp_is_front_page',
),
However, the custom function is not being run. I have it set as below:
function cfp_is_front_page( $metabox ) {
do_action( 'inspect', [ 'metabox', $metabox ] );
if ( is_front_page() ) {
return true;
}
return false;
}
I'm not sure the is_front_page() function will work correctly in the admin end anyway, but it seems the function isn't even being called as the 'inspect' action isn't running.