Ticket #17463: 17463.diff
File 17463.diff, 4.0 KB (added by , 14 years ago) |
---|
-
wp-admin/includes/nav-menu.php
628 628 629 629 if ( !$posts ) 630 630 $error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>'; 631 631 632 632 $db_fields = false; 633 633 if ( is_post_type_hierarchical( $post_type_name ) ) { 634 634 $db_fields = array( 'parent' => 'post_parent', 'id' => 'ID' ); … … 743 743 'url' => home_url('/'), 744 744 ) ); 745 745 } 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 '_add_to_top' => true, 750 'ID' => 0, 751 'object_id' => $_nav_menu_placeholder, 752 'post_content' => '', 753 'post_excerpt' => '', 754 'post_title' => $post_type['args']->labels->items_archive, 755 'post_type' => 'nav_menu_item', 756 'type' => 'custom', 757 'url' => site_url( $post_type['args']->archive_slug ), 758 ) ); 746 759 } 747 760 748 761 $checkbox_items = walk_nav_menu_tree( array_map('wp_setup_nav_menu_item', $posts), 0, (object) $args ); -
wp-includes/post.php
984 984 $wp_rewrite->add_rewrite_tag("%$post_type%", '([^/]+)', $args->query_var ? "{$args->query_var}=" : "post_type=$post_type&name="); 985 985 986 986 if ( $args->has_archive ) { 987 $ar chive_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; 988 988 if ( $args->rewrite['with_front'] ) 989 $ar chive_slug = substr( $wp_rewrite->front, 1 ) . $archive_slug;989 $args->archive_slug = substr( $wp_rewrite->front, 1 ) . $args->archive_slug; 990 990 else 991 $ar chive_slug = $wp_rewrite->root . $archive_slug;991 $args->archive_slug = $wp_rewrite->root . $args->archive_slug; 992 992 993 $wp_rewrite->add_rule( "{$ar chive_slug}/?$", "index.php?post_type=$post_type", 'top' );993 $wp_rewrite->add_rule( "{$args->archive_slug}/?$", "index.php?post_type=$post_type", 'top' ); 994 994 if ( $args->rewrite['feeds'] && $wp_rewrite->feeds ) { 995 995 $feeds = '(' . trim( implode( '|', $wp_rewrite->feeds ) ) . ')'; 996 $wp_rewrite->add_rule( "{$ar chive_slug}/feed/$feeds/?$", "index.php?post_type=$post_type" . '&feed=$matches[1]', 'top' );997 $wp_rewrite->add_rule( "{$ar chive_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' ); 998 998 } 999 999 if ( $args->rewrite['pages'] ) 1000 $wp_rewrite->add_rule( "{$ar chive_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' ); 1001 1001 } 1002 1002 1003 1003 $wp_rewrite->add_permastruct($post_type, "{$args->rewrite['slug']}/%$post_type%", $args->rewrite['with_front'], $args->permalink_epmask); … … 1166 1166 'not_found' => array( __('No posts found.'), __('No pages found.') ), 1167 1167 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1168 1168 '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' ) ), 1170 1171 ); 1171 1172 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; 1172 1173 return _get_custom_object_labels( $post_type_object, $nohier_vs_hier_defaults );