Ticket #25474: 25474.2.diff
File 25474.2.diff, 3.0 KB (added by , 12 years ago) |
---|
-
trunk/wp-admin/includes/nav-menu.php
498 498 return; 499 499 500 500 foreach ( $post_types as $post_type ) { 501 /** 502 * Filter the post types used as menu item metaboxes. 503 * 504 * If you return a falsey value instead of a post type object, 505 * the post type will be excluded as a menu item metabox. 506 * 507 * @since 3.0.0 508 * 509 * @param object $post_type The post type object to be used as a metabox. 510 */ 501 511 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); 502 512 if ( $post_type ) { 503 513 $id = $post_type->name; … … 520 530 return; 521 531 522 532 foreach ( $taxonomies as $tax ) { 533 /** 534 * Filter the taxonomies used as menu item metaboxes. 535 * 536 * If you return a falsey value instead of a taxonomy object, 537 * the taxonomy will be excluded as a menu item metabox. 538 * 539 * @since 3.0.0 540 * 541 * @param object $tax The taxonomy object to be used as a metabox. 542 */ 523 543 $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); 524 544 if ( $tax ) { 525 545 $id = $tax->name; … … 775 795 } 776 796 } 777 797 778 $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type ); 798 /** 799 * Filter the posts displayed in the View All tab of the menu item metabox for a specific post type. 800 * 801 * @since 3.2.0 802 * 803 * @param array $posts All of the posts for the current post type. 804 * @param array $args An array of arguments. @see WP_QUERY::query() 805 * @param object $post_type The current post type object for this menu item metabox. 806 */ 807 $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); 779 808 $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args ); 780 809 781 810 if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { … … 1132 1161 if( empty($menu_items) ) 1133 1162 return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; 1134 1163 1135 $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );1164 $walker_class_name = 'Walker_Nav_Menu_Edit'; 1136 1165 1166 /** 1167 * Filter the Walker used to render a menu formatted for editing. 1168 * 1169 * @since 3.0.0 1170 * 1171 * @param string $walker_class_name The Walker class used to render a menu formatted for editing. 1172 * @param int $menu_id The id of the menu being rendered. 1173 */ 1174 $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', $walker_class_name, $menu_id ); 1175 1137 1176 if ( class_exists( $walker_class_name ) ) 1138 1177 $walker = new $walker_class_name; 1139 1178 else … … 1276 1315 1277 1316 wp_defer_term_counting( false ); 1278 1317 1318 //duplicate_hook 1279 1319 do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); 1280 1320 1281 1321 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';