Ticket #9674: 9674.17.diff
File 9674.17.diff, 3.9 KB (added by , 15 years ago) |
---|
-
wp-includes/post.php
16 16 */ 17 17 function create_initial_post_types() { 18 18 register_post_type( 'post', array( 'label' => __('Posts'), 19 'publicly_queryable' => true, 19 20 'exclude_from_search' => false, 20 21 '_builtin' => true, 21 22 '_edit_link' => 'post.php?post=%d', … … 25 26 ) ); 26 27 27 28 register_post_type( 'page', array( 'label' => __('Pages'), 29 'publicly_queryable' => true, 28 30 'exclude_from_search' => false, 29 31 '_builtin' => true, 30 32 '_edit_link' => 'post.php?post=%d', … … 707 709 $wp_post_types = array(); 708 710 709 711 // Args prefixed with an underscore are reserved for internal use. 710 $defaults = array('label' => false, ' exclude_from_search' => true, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, '_show' => false, 'supports' => array());712 $defaults = array('label' => false, 'publicly_queryable' => false, 'exclude_from_search' => true, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, '_show' => false, 'supports' => array()); 711 713 $args = wp_parse_args($args, $defaults); 712 714 $args = (object) $args; 713 715 -
wp-includes/classes.php
26 26 * @access public 27 27 * @var array 28 28 */ 29 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage' );29 var $public_query_vars = array('m', 'p', 'posts', 'w', 'cat', 'withcomments', 'withoutcomments', 's', 'search', 'exact', 'sentence', 'debug', 'calendar', 'page', 'paged', 'more', 'tb', 'pb', 'author', 'order', 'orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'tag', 'feed', 'author_name', 'static', 'pagename', 'page_id', 'error', 'comments_popup', 'attachment', 'attachment_id', 'subpost', 'subpost_id', 'preview', 'robots', 'taxonomy', 'term', 'cpage', 'post_type'); 30 30 31 31 /** 32 32 * Private query variables. … … 36 36 * @since 2.0.0 37 37 * @var array 38 38 */ 39 var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_ type', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page');39 var $private_query_vars = array('offset', 'posts_per_page', 'posts_per_archive_page', 'showposts', 'nopaging', 'post_status', 'category__in', 'category__not_in', 'category__and', 'tag__in', 'tag__not_in', 'tag__and', 'tag_slug__in', 'tag_slug__and', 'tag_id', 'post_mime_type', 'perm', 'comments_per_page'); 40 40 41 41 /** 42 42 * Extra query variables set by the user. … … 277 277 } 278 278 } 279 279 } 280 281 //limit publicly queried post_types to those that are publicly_queryable 282 if( isset( $this->query_vars['post_type'])) { 283 $queryable_post_types = get_post_types( array('publicly_queryable' => true) ); 284 if( ! in_array( $this->query_vars['post_type'], $queryable_post_types ) ) 285 unset( $this->query_vars['post_type'] ); 286 } 280 287 281 288 foreach ( (array) $this->private_query_vars as $var) { 282 289 if (isset($this->extra_query_vars[$var]))