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

返回介绍

require_if_theme_supports()

发布于 2017-09-11 字数1286 浏览 890 评论 0

require_if_theme_supports( string $feature,  string $include )

Checks a theme’s support for a given feature before loading the functions which implement it.


描述


参数

$feature

(string)
(Required)
The feature being checked.

$include

(string)
(Required)
Path to the file.


返回值

(bool) True if the current theme supports the supplied feature, false otherwise.


源代码

File: wp-includes/theme.php

function require_if_theme_supports( $feature, $include ) {
	if ( current_theme_supports( $feature ) ) {
		require ( $include );
		return true;
	}
	return false;
}

更新日志

Version 描述
2.9.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    current_theme_supports()

User Contributed Notes

发布评论

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

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