wp_style_is

函式
wp_style_is ( $handle, $list = 'enqueued' )
引數
  • (string) $handle Name of the stylesheet.
    Required:
  • (string) $list Optional. Status of the stylesheet to check. Default 'enqueued'. Accepts 'enqueued', 'registered', 'queue', 'to_do', and 'done'.
    Required:
    Default: 'enqueued'
返回值
  • (bool) Whether style is queued.
定義位置
相關方法
wp_styleswp_script_iswp_title_rsswp_site_iconwp_print_styles
引入
2.8.0
棄用
-

wp_style_is。它檢查一個樣式表是否已經被註冊: 該函式檢查一個具有給定控制代碼的樣式表是否已經被註冊。

檢查是否有一個CSS樣式表被新增到佇列中。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_style_is( $handle, $list = 'enqueued' ) {
_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );
return (bool) wp_styles()->query( $handle, $list );
}
function wp_style_is( $handle, $list = 'enqueued' ) { _wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle ); return (bool) wp_styles()->query( $handle, $list ); }
function wp_style_is( $handle, $list = 'enqueued' ) {
	_wp_scripts_maybe_doing_it_wrong( __FUNCTION__, $handle );

	return (bool) wp_styles()->query( $handle, $list );
}

常見問題

FAQs
檢視更多 >