is_day() - WordPress 函数参考中文文档

返回介绍

is_day()

发布于 2017-09-11 字数 1783 浏览 940 评论 0

is_day()

Is the query for an existing day archive?


描述


返回值

(bool)


源代码

File: wp-includes/query.php

function is_day() {
	global $wp_query;

	if ( ! isset( $wp_query ) ) {
		_doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
		return false;
	}

	return $wp_query->is_day();
}

更新日志

Version 描述
1.5.0 Introduced.

相关函数

Uses

  • wp-includes/l10n.php:
    __()
  • wp-includes/class-wp-query.php:
    WP_Query::is_day()
  • wp-includes/functions.php:
    _doing_it_wrong()

Used By

  • wp-includes/general-template.php:
    wp_get_document_title()
  • wp-includes/general-template.php:
    get_the_archive_title()
  • wp-includes/canonical.php:
    redirect_canonical()

User Contributed Notes

  1. Skip to note content

    You must log in to vote on the helpfulness of this noteVote results for this note: 0You must log in to vote on the helpfulness of this note

    Contributed by Codex

    Check if current archive is day archive.

    
    if ( is_day() ) {
    	// Do awesome.
    }
    

上一篇:is_date()

下一篇:is_dynamic_sidebar()

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!