Ticket #25474: 25474.3.diff
File 25474.3.diff, 3.1 KB (added by , 12 years ago) |
---|
-
src/wp-admin/includes/nav-menu.php
503 503 return; 504 504 505 505 foreach ( $post_types as $post_type ) { 506 /** 507 * Filter whether a menu items meta box will be added for the current post type. 508 * 509 * If a falsey value is returned instead of a post type object, 510 * the post type menu items meta box will not be added. 511 * 512 * @since 3.0.0 513 * 514 * @param object $post_type The post type object to be used as a meta box. 515 */ 506 516 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type ); 507 517 if ( $post_type ) { 508 518 $id = $post_type->name; … … 525 535 return; 526 536 527 537 foreach ( $taxonomies as $tax ) { 538 /** 539 * Filter whether a menu items meta box will be added for the current taxonomy. 540 * 541 * If a falsey value is returned instead of a taxonomy object, 542 * the taxonomy menu items meta box will not be added. 543 * 544 * @since 3.0.0 545 * 546 * @param object $tax The taxonomy object to be used as a meta box. 547 */ 528 548 $tax = apply_filters( 'nav_menu_meta_box_object', $tax ); 529 549 if ( $tax ) { 530 550 $id = $tax->name; … … 780 800 } 781 801 } 782 802 783 $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type ); 803 /** 804 * Filter the posts displayed in the 'View All' tab of the current 805 * post type's menu items meta box. 806 * 807 * The dynamic portion of the hook name, $post_type_name, 808 * refers to the slug of the current post type. 809 * 810 * @since 3.2.0 811 * 812 * @see WP_Query::query() 813 * 814 * @param array $posts The posts for the current post type. 815 * @param array $args An array of WP_Query arguments. 816 * @param object $post_type The current post type object for this menu item meta box. 817 */ 818 $posts = apply_filters( "nav_menu_items_{$post_type_name}", $posts, $args, $post_type ); 784 819 $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args ); 785 820 786 821 if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) { … … 1137 1172 if( empty($menu_items) ) 1138 1173 return $result . ' <ul class="menu" id="menu-to-edit"> </ul>'; 1139 1174 1175 /** 1176 * Filter the Walker class used to render a menu formatted for editing. 1177 * 1178 * @since 3.0.0 1179 * 1180 * @param string $walker_class_name The Walker class used to render a menu formatted for editing. 1181 * @param int $menu_id The ID of the menu being rendered. 1182 */ 1140 1183 $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id ); 1141 1184 1142 1185 if ( class_exists( $walker_class_name ) ) … … 1281 1324 1282 1325 wp_defer_term_counting( false ); 1283 1326 1327 /** This action is documented in wp-includes/nav-menu.php */ 1284 1328 do_action( 'wp_update_nav_menu', $nav_menu_selected_id ); 1285 1329 1286 1330 $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';