wpseek.com
WordPress开发者和主题制作者的搜索引擎



require_if_theme_supports › WordPress Function

Since2.9.0
已弃用n/a
require_if_theme_supports ( $feature, $file )
参数: (2)
  • (string) $feature The feature being checked. See add_theme_support() for the list of possible values.
    Required: Yes
  • (string) $file Path to the file.
    Required: Yes
返回:
  • (bool) True if the active theme supports the supplied feature, false otherwise.
定义在:
文档:

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



源码

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