Make WordPress Core

Ticket #25474: 25474.3.diff

File 25474.3.diff, 3.1 KB (added by DrewAPicture, 12 years ago)

fix duplicate comment, other wording

  • src/wp-admin/includes/nav-menu.php

     
    503503                return;
    504504
    505505        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                 */
    506516                $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
    507517                if ( $post_type ) {
    508518                        $id = $post_type->name;
     
    525535                return;
    526536
    527537        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                 */
    528548                $tax = apply_filters( 'nav_menu_meta_box_object', $tax );
    529549                if ( $tax ) {
    530550                        $id = $tax->name;
     
    780800                                        }
    781801                                }
    782802
    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 );
    784819                                $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args );
    785820
    786821                                if ( 'all' == $current_tab && ! empty( $_REQUEST['selectall'] ) ) {
     
    11371172                if( empty($menu_items) )
    11381173                        return $result . ' <ul class="menu" id="menu-to-edit"> </ul>';
    11391174
     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                 */
    11401183                $walker_class_name = apply_filters( 'wp_edit_nav_menu_walker', 'Walker_Nav_Menu_Edit', $menu_id );
    11411184
    11421185                if ( class_exists( $walker_class_name ) )
     
    12811324
    12821325        wp_defer_term_counting( false );
    12831326
     1327        /** This action is documented in wp-includes/nav-menu.php */
    12841328        do_action( 'wp_update_nav_menu', $nav_menu_selected_id );
    12851329
    12861330        $messages[] = '<div id="message" class="updated"><p>' . sprintf( __( '<strong>%1$s</strong> has been updated.' ), $nav_menu_selected_title ) . '</p></div>';