do_meta_boxes HOOK runs 3 times (how to stop it) (2 posts)

  1. volleyballmaniac
    Posted 2 years ago #

    the do_meta_boxes HOOK runs 3 times in this file:

    do_action('do_meta_boxes', $post_type, 'normal', $post);
    do_action('do_meta_boxes', $post_type, 'advanced', $post);
    do_action('do_meta_boxes', $post_type, 'side', $post);

    This causes everything I do (like var_dumps) to be spit out 3 times.

    What can I add to my function to only have it run for a certain context, like just "advanced", and not the others?

  2. Eric Andrew Lewis
    Posted 1 year ago #

    Conditionally check in your callback the value of that variable and return early if it's not 'advanced'

Topic Closed

This topic has been closed to new replies.

About this Topic