Custom function not running

Support MB Include Exclude Custom function not runningResolved

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #45582
    chillifishchillifish
    Participant

    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.

    #45585
    chillifishchillifish
    Participant

    My fault, I'd inadvertently changed the name of the rwmb_meta_boxes filter, so nothing was running…

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.