Warning: Trying to access array offset on false in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 216
current_theme_supports() - 检查主题是否支持给定功能 - WordPress函数 - WordPress动力
当前浏览:首页 / WordPress函数 / current_theme_supports()

current_theme_supports( string $feature, mixed $args )

检查主题是否支持给定功能


Warning: Undefined array key -1 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 185

Warning: Undefined array key 3 in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/reference-cat.php on line 186

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "08ae7a4539ec730f2face27f4d8b243c" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "bf54a07380c4a5252b20c594890f77be" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

Warning: Undefined variable $searchand in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 154

Warning: Undefined array key "3a41fd57de8104db46dad2693d7f2deb" in /www/wwwroot/www.wpdongli.com/wp-content/themes/WPdongli/functions/wp.php on line 223

current

support 支持

theme 主题more...


描述

示例用法:

current_theme_supports( 'custom-logo' );
current_theme_supports( 'html5', 'comment-form' );

参数

$feature

(string) (必填) 要检查的功能,有关可能值的列表,请参见add_theme_support()。

$args

(mixed) (可选) 根据某些功能检查额外参数。


返回

(bool) 如果启用的主题支持该功能,则为true,否则为false。



源码

查看源码 官方文档


更新日志

版本描述
5.3.0通过将现有和已记录的...$args参数添加到函数签名中,将其形参化
2.9.0开始引入

使用示例

  • 示例1

    基本示例

    <?php 
    if (current_theme_supports('custom-header')) {
      // do something special when custom-header is supported...
    }
    ?>