is_time

函数
is_time ( No parameters )
返回值
  • (bool) Whether the query is for a specific time.
定义位置
相关方法
is_homeis_termis_dateis_gd_imagethe_time
引入
1.5.0
弃用
-

is_time是一个WordPress的函数,它检查给定的字符串是否是格式为”HH:MM:SS”的有效时间。如果时间是有效的,它返回一个布尔值true,否则返回false。

确定查询是否为一个特定的时间。

关于这个和类似主题函数的更多信息,请查看《主题开发者手册》中的{@link Conditional Tags}文章。

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();
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 17:32:57

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: