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

返回介绍

get_current_theme()

发布于 2017-09-10 字数1705 浏览 859 评论 0

Warning: This function has been deprecated. Use wp_get_theme() instead.

get_current_theme()

Retrieve current theme name.


描述


返回值

(string)


源代码

File: wp-includes/deprecated.php

function get_current_theme() {
	_deprecated_function( __FUNCTION__, '3.4.0', 'wp_get_theme()' );

	if ( $theme = get_option( 'current_theme' ) )
		return $theme;

	return wp_get_theme()->get('Name');
}

更新日志

Version 描述
3.4.0 Use wp_get_theme()
1.5.0 Introduced.

相关函数

Uses

  • wp-includes/theme.php:
    wp_get_theme()
  • wp-includes/class-wp-theme.php:
    WP_Theme::get()
  • wp-includes/functions.php:
    _deprecated_function()
  • wp-includes/option.php:
    get_option()

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

    Current theme name
    Get the name of the current theme.

    
    $theme_name = get_current_theme();
    echo esc_html( $theme_name );
    

发布评论

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

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