Ticket #16075: 16075.4.diff
File 16075.4.diff, 3.5 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/nav-menu.php
767 767 'url' => home_url('/'), 768 768 ) ); 769 769 } 770 } elseif ( $post_type['args']->has_archive ) { 771 $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; 772 array_unshift( $posts, (object) array( 773 'ID' => 0, 774 'object_id' => $_nav_menu_placeholder, 775 'post_content' => '', 776 'post_excerpt' => '', 777 'post_parent' => '', 778 'post_title' => $post_type['args']->labels->items_archive, 779 'post_type' => 'nav_menu_item', 780 'type' => 'custom', 781 'url' => site_url( $post_type['args']->archive_slug ), 782 ) ); 770 783 } 771 784 772 785 $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type ); -
wp-includes/post.php
1314 1314 add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 1315 1315 1316 1316 if ( $args->has_archive ) { 1317 $ar chive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive;1317 $args->archive_slug = $args->has_archive === true ? $args->rewrite['slug'] : $args->has_archive; 1318 1318 if ( $args->rewrite['with_front'] ) 1319 $ar chive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;1319 $args->archive_slug = substr( $wp_rewrite->front, 1 ) . $args->archive_slug; 1320 1320 else 1321 $ar chive_slug = $wp_rewrite->root . $archive_slug;1321 $args->archive_slug = $wp_rewrite->root . $args->archive_slug; 1322 1322 1323 add_rewrite_rule( "{$archive_slug}/?$", "index.php?post_type=$post_type", 'top' );1323 $wp_rewrite->add_rule( "{$args->archive_slug}/?$", "index.php?post_type=$post_type", 'top' ); 1324 1324 if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) { 1325 1325 $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')'; 1326 add_rewrite_rule( "{$archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );1327 add_rewrite_rule( "{$archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );1326 $wp_rewrite->add_rule( "{$args->archive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 1327 $wp_rewrite->add_rule( "{$args->archive_slug}/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' ); 1328 1328 } 1329 1329 if ( $args->rewrite['pages'] ) 1330 add_rewrite_rule( "{$archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' );1330 $wp_rewrite->add_rule( "{$args->archive_slug}/{$wp_rewrite->pagination_base}/([0-9]{1,})/?$", "index.php?post_type=$post_type" . '&paged=$matches[1]', 'top' ); 1331 1331 } 1332 1332 1333 1333 add_permastruct( $post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite ); … … 1504 1504 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1505 1505 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1506 1506 'parent_item_colon' => array( null, __('Parent Page:') ), 1507 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1507 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1508 'items_archive' => array( __( 'Post Archive' ), __( 'Page Archive' ) ), 1508 1509 ); 1509 1510 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1510 1511