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
檢視更多 >