WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. volleyballmaniac
    Member
    Posted 1 year ago #

    the do_meta_boxes HOOK runs 3 times in this file:
    http://svn.automattic.com/wordpress/tags/3.5/wp-admin/edit-form-advanced.php

    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
    Member
    Posted 10 months 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