Change custom post_type default Rewrite endpoint mask to EP_PERMALINK to ensure comment paging rules are added. Removes redundant/non-usable EP_NONE branch. Fixes #13086

git-svn-id: http://svn.automattic.com/wordpress/trunk@14219 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
dd32 2010-04-24 14:42:30 +00:00
parent d0cb517220
commit 356a50d1f0
2 changed files with 2 additions and 2 deletions

View File

@ -799,7 +799,7 @@ function register_post_type($post_type, $args = array()) {
$wp_post_types = array();
// Args prefixed with an underscore are reserved for internal use.
$defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_NONE );
$defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK );
$args = wp_parse_args($args, $defaults);
$args = (object) $args;

View File

@ -1399,7 +1399,7 @@ class WP_Rewrite {
$rewrite = array_merge($rewrite, array($pagematch => $pagequery));
//only on pages with comments add ../comment-page-xx/
if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask || EP_NONE & $ep_mask )
if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask )
$rewrite = array_merge($rewrite, array($commentmatch => $commentquery));
else if ( EP_ROOT & $ep_mask && get_option('page_on_front') )
$rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery));