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

返回介绍

is_time()

发布于 2017-09-11 字数1514 浏览 996 评论 0

is_time()

Is the query for a specific time?


描述


返回值

(bool)


源代码

File: wp-includes/query.php

function is_time() {
	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_time();
}

更新日志

Version 描述
1.5.0 Introduced.

相关函数

Uses

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

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 time archive.

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

上一篇:is_textdomain_loaded()

下一篇:is_trackback()

发布评论

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

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