Ticket #9674: register_meta_box_cb.diff
File register_meta_box_cb.diff, 2.6 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
708 708 * delete_cap - The capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post). 709 709 * hierarchical - Whether the post type is hierarchical. Defaults to false. 710 710 * supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none. 711 * register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback. 711 712 * 712 713 * @package WordPress 713 714 * @subpackage Post … … 724 725 $wp_post_types = array(); 725 726 726 727 // Args prefixed with an underscore are reserved for internal use. 727 $defaults = array('label' => false, 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, '_show' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array() );728 $defaults = array('label' => false, 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, '_show' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null); 728 729 $args = wp_parse_args($args, $defaults); 729 730 $args = (object) $args; 730 731 … … 783 784 $wp_rewrite->add_permastruct($post_type, "/{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front']); 784 785 } 785 786 787 if ( $args->register_meta_box_cb ) 788 add_action('add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1); 789 786 790 $wp_post_types[$post_type] = $args; 787 791 788 792 return $args; -
wp-admin/edit-form-advanced.php
139 139 if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) 140 140 add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', $post_type, 'normal', 'core'); 141 141 142 do_action('add_meta_boxes', $post_type, $post); 143 do_action('add_meta_boxes_' . $post_type, $post); 144 142 145 do_action('do_meta_boxes', $post_type, 'normal', $post); 143 146 do_action('do_meta_boxes', $post_type, 'advanced', $post); 144 147 do_action('do_meta_boxes', $post_type, 'side', $post);