get_stylesheet

函数
get_stylesheet ( No parameters )
返回值
  • (string) Stylesheet name.
定义位置
相关方法
get_stylesheet_uriget_editor_stylesheetslocale_stylesheetwp_get_global_stylesheetget_stylesheet_directory
引入
1.5.0
弃用
-

get_stylesheet: 这个函数检索网站当前使用的样式表的名称。它不需要任何参数,并以字符串的形式返回样式表的名称。

检索当前样式表的名称。

当前被设置为前端主题的主题名称。

对于所有的意图和目的,模板名称和样式表名称在大多数情况下都是一样的。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_stylesheet() {
/**
* Filters the name of current stylesheet.
*
* @since 1.5.0
*
* @param string $stylesheet Name of the current stylesheet.
*/
return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );
}
function get_stylesheet() { /** * Filters the name of current stylesheet. * * @since 1.5.0 * * @param string $stylesheet Name of the current stylesheet. */ return apply_filters( 'stylesheet', get_option( 'stylesheet' ) ); }
function get_stylesheet() {
	/**
	 * Filters the name of current stylesheet.
	 *
	 * @since 1.5.0
	 *
	 * @param string $stylesheet Name of the current stylesheet.
	 */
	return apply_filters( 'stylesheet', get_option( 'stylesheet' ) );
}

常见问题

FAQs
查看更多 >