Make WordPress Core

Ticket #34231: 34231.patch

File 34231.patch, 1.2 KB (added by sebastian.pisula, 11 years ago)
  • wp-includes/query.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    140140 *
    141141 * @global WP_Query $wp_query Global WP_Query instance.
    142142 *
     143 * @param string|array $post_types Optional. Post type or array of posts types to check against.
    143144 * @return bool
    144145 */
    145 function is_archive() {
     146function is_archive( $post_types = '' ) {
    146147        global $wp_query;
    147148
    148149        if ( ! isset( $wp_query ) ) {
    … …  
    150151                return false;
    151152        }
    152153
    153         return $wp_query->is_archive();
     154        return $wp_query->is_archive( $post_types );
    154155}
    155156
    156157/**
    … …  
    40784079         *
    40794080         * @since 3.1.0
    40804081         *
     4082         * @param string|array $post_types Optional. Post type or array of posts types to check against.
     4083         *
    40814084         * @return bool
    40824085         */
    4083         public function is_archive() {
     4086        public function is_archive( $post_types = '' ) {
     4087                if ( ! empty( $post_types )) {
     4088                        return $this->is_post_type_archive( $post_types );
     4089                }
     4090
    40844091                return (bool) $this->is_archive;
    40854092        }
    40864093