From 356a50d1f0e43f3535e34da7a165d43927e25401 Mon Sep 17 00:00:00 2001 From: dd32 Date: Sat, 24 Apr 2010 14:42:30 +0000 Subject: [PATCH] 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 --- wp-includes/post.php | 2 +- wp-includes/rewrite.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 93ae587e0..e0756ba9a 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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; diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 0a4919353..2274982a2 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -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));