Ensure the nav_menu_meta_box_object filter hook is only documented once.

See #26869.

Built from https://develop.svn.wordpress.org/trunk@28207


git-svn-id: http://core.svn.wordpress.org/trunk@28037 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Drew Jaynes 2014-04-25 06:14:15 +00:00
parent a43313fe12
commit a9b74e2088
2 changed files with 9 additions and 22 deletions

View File

@ -1174,14 +1174,8 @@ function wp_ajax_menu_get_metabox() {
if ( ! empty( $_POST['item-object'] ) && isset( $items[$_POST['item-object']] ) ) {
$menus_meta_box_object = $items[ $_POST['item-object'] ];
/**
* Filter a nav menu meta box object.
*
* @since 3.0.0
*
* @param object $menus_meta_box_object A nav menu meta box object, such as Page,
* Post, Category, Tag, etc.
*/
/** This filter is documented in wp-admin/includes/nav-menu.php */
$item = apply_filters( 'nav_menu_meta_box_object', $menus_meta_box_object );
ob_start();
call_user_func_array($callback, array(

View File

@ -503,14 +503,16 @@ function wp_nav_menu_post_type_meta_boxes() {
foreach ( $post_types as $post_type ) {
/**
* Filter whether a menu items meta box will be added for the current post type.
* Filter whether a menu items meta box will be added for the current
* object type.
*
* If a falsey value is returned instead of a post type object,
* the post type menu items meta box will not be added.
* If a falsey value is returned instead of an object, the menu items
* meta box for the current meta box object will not be added.
*
* @since 3.0.0
*
* @param object $post_type The post type object to be used as a meta box.
* @param object $meta_box_object The current object to add a menu items
* meta box for.
*/
$post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
if ( $post_type ) {
@ -534,16 +536,7 @@ function wp_nav_menu_taxonomy_meta_boxes() {
return;
foreach ( $taxonomies as $tax ) {
/**
* Filter whether a menu items meta box will be added for the current taxonomy.
*
* If a falsey value is returned instead of a taxonomy object,
* the taxonomy menu items meta box will not be added.
*
* @since 3.0.0
*
* @param object $tax The taxonomy object to be used as a meta box.
*/
/** This filter is documented in wp-admin/includes/nav-menu.php */
$tax = apply_filters( 'nav_menu_meta_box_object', $tax );
if ( $tax ) {
$id = $tax->name;