WordPress.org

Make WordPress Core

Changeset 15937


Ignore:
Timestamp:
10/23/10 19:20:47 (7 years ago)
Author:
nacin
Message:

Remove post_type params from is_archive(). use is_post_type_archive() for full context. see #13818.

Location:
trunk/wp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r15936 r15937  
    860860 *     types and page labels for hierarchical ones. You can see accepted values in {@link get_post_type_labels()}. 
    861861 * - permalink_epmask - The default rewrite endpoint bitmasks. 
    862  * - has_archive - Whether to have a post type archive. Will generate the proper rewrite rules if rewrite is enabled. 
     862 * - has_archive - True to enable post type archives. Will generate the proper rewrite rules if rewrite is enabled. 
    863863 * - rewrite - false to prevent rewrite. Defaults to true. Use array('slug'=>$slug) to customize permastruct; 
    864864 *     default will use $post_type as slug. Other options include 'with_front' and 'feeds'. 
  • trunk/wp-includes/query.php

    r15936 r15937  
    101101 * Is the query for an archive page? 
    102102 * 
    103  * Month, Year, Category, Author, ... 
    104  * 
    105  * If the $post_types parameter is specified, this function will additionally 
    106  * check if the query is for exactly one of the post types specified. If a plugin 
    107  * is causing multiple post types to appear in the query, specifying a post type 
    108  * will cause this check to return false. 
     103 * Month, Year, Category, Author, Post Type archive... 
    109104 * 
    110105 * @see WP_Query::is_archive() 
     
    112107 * @uses $wp_query 
    113108 * 
    114  * @param mixed $post_types Optional. Post type or array of post types 
    115109 * @return bool 
    116110 */ 
     
    26452639     * Is the query for an archive page? 
    26462640     * 
    2647      * Month, Year, Category, Author, ... 
    2648      * 
    2649      * If the $post_types parameter is specified, this function will additionally 
    2650      * check if the query is for exactly one of the post types specified. If a plugin 
    2651      * is causing multiple post types to appear in the query, specifying a post type 
    2652      * will cause this check to return false. 
     2641     * Month, Year, Category, Author, Post Type archive... 
    26532642     * 
    26542643     * @since 3.1.0 
    26552644     * 
    2656      * @param mixed $post_types Optional. Post type or array of post types 
    26572645     * @return bool 
    26582646     */ 
    26592647    function is_archive( $post_types ) { 
    2660         if ( empty( $post_types ) || !$this->is_archive ) 
    2661             return (bool) $this->is_archive; 
    2662  
    2663         if ( ! isset( $this->posts[0] ) ) 
    2664             return false; 
    2665  
    2666         $post = $this->posts[0]; 
    2667  
    2668         return in_array( $post->post_type, (array) $post_types ); 
     2648        return (bool) $this->is_archive; 
    26692649    } 
    26702650 
Note: See TracChangeset for help on using the changeset viewer.