Make WordPress Core

Ticket #23749: 23749.2.diff

File 23749.2.diff, 1.6 KB (added by helen, 11 years ago)
  • src/wp-includes/query.php

     
    292292}
    293293
    294294/**
     295 * Is the query for a post format archive page?
     296 *
     297 * If the $format parameter is specified, this function will check
     298 * if the query is for one of the formats specified.
     299 *
     300 * @since 3.9.0
     301 * @uses $wp_query
     302 *
     303 * @param mixed $format Optional. Format slug or array of format slugs, without the post-format prefix.
     304 * @return bool
     305 */
     306function is_post_format_archive( $format = '' ) {
     307        global $wp_query;
     308
     309        if ( ! isset( $wp_query ) ) {
     310                return false;
     311        }
     312
     313        return $wp_query->is_post_format_archive( $format );
     314}
     315
     316/**
    295317 * Whether the current URL is within the comments popup window.
    296318 *
    297319 * @see WP_Query::is_comments_popup()
     
    39443966        }
    39453967
    39463968        /**
     3969         * Is the query for a post format archive page?
     3970         *
     3971         * If the $format parameter is specified, this function will check
     3972         * if the query is for one of the formats specified.
     3973         *
     3974         * @since 3.9.0
     3975         *
     3976         * @param mixed $format Optional. Format slug or array of format slugs, without the post-format prefix.
     3977         * @return bool
     3978         */
     3979        function is_post_format_archive( $format = '' ) {
     3980                if ( ! empty( $format ) ) {
     3981                        $format = (array) $format;
     3982
     3983                        foreach ( $format as &$value ) {
     3984                                $value = 'post-format-' . $value;
     3985                        }
     3986                }
     3987
     3988                return $this->is_tax( 'post_format', $format );
     3989        }
     3990
     3991        /**
    39473992         * Whether the current URL is within the comments popup window.
    39483993         *
    39493994         * @since 3.1.0