Ticket #16075: 16075.2-refresh.diff
File 16075.2-refresh.diff, 3.5 KB (added by , 12 years ago) |
---|
-
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 -
wp-admin/includes/nav-menu.php
745 745 'url' => home_url('/'), 746 746 ) ); 747 747 } 748 } elseif ( $post_type['args']->has_archive ) { 749 $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1; 750 array_unshift( $posts, (object) array( 751 'ID' => 0, 752 'object_id' => $_nav_menu_placeholder, 753 'post_content' => '', 754 'post_excerpt' => '', 755 'post_title' => $post_type['args']->labels->items_archive, 756 'post_type' => 'nav_menu_item', 757 'type' => 'custom', 758 'url' => site_url( $post_type['args']->archive_slug ), 759 ) ); 748 760 } 749 761 750 762 $posts = apply_filters( 'nav_menu_items_'.$post_type_name, $posts, $args, $post_type );