diff --git a/wp-includes/post.php b/wp-includes/post.php index bd2a0d13a0..0569ad7a7f 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -859,7 +859,7 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * - labels - An array of labels for this post type. By default post labels are used for non-hierarchical * types and page labels for hierarchical ones. You can see accepted values in {@link get_post_type_labels()}. * - permalink_epmask - The default rewrite endpoint bitmasks. - * - has_archive - Whether to have a post type archive. Will generate the proper rewrite rules if rewrite is enabled. + * - has_archive - True to enable post type archives. Will generate the proper rewrite rules if rewrite is enabled. * - rewrite - false to prevent rewrite. Defaults to true. Use array('slug'=>$slug) to customize permastruct; * default will use $post_type as slug. Other options include 'with_front' and 'feeds'. * - query_var - false to prevent queries, or string to value of the query var to use for this post type diff --git a/wp-includes/query.php b/wp-includes/query.php index ce479d6fbe..950ae6cf8f 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -100,18 +100,12 @@ function wp_reset_postdata() { /** * Is the query for an archive page? * - * Month, Year, Category, Author, ... - * - * If the $post_types parameter is specified, this function will additionally - * check if the query is for exactly one of the post types specified. If a plugin - * is causing multiple post types to appear in the query, specifying a post type - * will cause this check to return false. + * Month, Year, Category, Author, Post Type archive... * * @see WP_Query::is_archive() * @since 1.5.0 * @uses $wp_query * - * @param mixed $post_types Optional. Post type or array of post types * @return bool */ function is_archive( $post_types = '' ) { @@ -2644,28 +2638,14 @@ class WP_Query extends WP_Object_Query { /** * Is the query for an archive page? * - * Month, Year, Category, Author, ... - * - * If the $post_types parameter is specified, this function will additionally - * check if the query is for exactly one of the post types specified. If a plugin - * is causing multiple post types to appear in the query, specifying a post type - * will cause this check to return false. + * Month, Year, Category, Author, Post Type archive... * * @since 3.1.0 * - * @param mixed $post_types Optional. Post type or array of post types * @return bool */ function is_archive( $post_types ) { - if ( empty( $post_types ) || !$this->is_archive ) - return (bool) $this->is_archive; - - if ( ! isset( $this->posts[0] ) ) - return false; - - $post = $this->posts[0]; - - return in_array( $post->post_type, (array) $post_types ); + return (bool) $this->is_archive; } /**