Make WordPress Core

Ticket #16075: 16075.2.diff

File 16075.2.diff, 3.7 KB (added by aaroncampbell, 14 years ago)
  • wp-admin/includes/nav-menu.php

     
    743743                                                        'url' => home_url('/'),
    744744                                                ) );
    745745                                        }
     746                                } elseif ( $post_type['args']->has_archive ) {
     747                                        $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
     748                                        array_unshift( $posts, (object) array(
     749                                                'ID' => 0,
     750                                                'object_id' => $_nav_menu_placeholder,
     751                                                'post_content' => '',
     752                                                'post_excerpt' => '',
     753                                                'post_title' => $post_type['args']->labels->items_archive,
     754                                                'post_type' => 'nav_menu_item',
     755                                                'type' => 'custom',
     756                                                'url' => site_url( $post_type['args']->archive_slug ),
     757                                        ) );
    746758                                }
    747759
    748760                                $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );
  • wp-includes/post.php

     
    984984                        $wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name=");
    985985
    986986                if ( $args->has_archive ) {
    987                         $archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
     987                        $args->archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;
    988988                        if ( $args->rewrite['with_front'] )
    989                                 $archive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;
     989                                $args->archive_slug = substr( $wp_rewrite->front, 1 ) . $args->archive_slug;
    990990                        else
    991                                 $archive_slug = $wp_rewrite->root . $archive_slug;
     991                                $args->archive_slug = $wp_rewrite->root . $args->archive_slug;
    992992
    993                         $wp_rewrite->add_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
     993                        $wp_rewrite->add_rule( "{$args->archive_slug}/?$", "index.php?post_type=$post_type", 'top' );
    994994                        if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) {
    995995                                $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')';
    996                                 $wp_rewrite->add_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
    997                                 $wp_rewrite->add_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
     996                                $wp_rewrite->add_rule( "{$args->archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
     997                                $wp_rewrite->add_rule( "{$args->archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );
    998998                        }
    999999                        if ( $args->rewrite['pages'] )
    1000                                 $wp_rewrite->add_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
     1000                                $wp_rewrite->add_rule( "{$args->archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );
    10011001                }
    10021002
    10031003                $wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask);
     
    11661166                'not_found' => array( __('No posts found.'), __('No pages found.') ),
    11671167                'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
    11681168                'parent_item_colon' => array( null, __('Parent Page:') ),
    1169                 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )
     1169                'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
     1170                'items_archive' => array( __( 'Post Archive' ), __( 'Page Archive' ) ),
    11701171        );
    11711172        $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
    11721173        return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );