remove_theme_support

函式
remove_theme_support ( $feature )
引數
  • (string) $feature The feature being removed. See add_theme_support() for the list of possible values.
    Required:
返回值
  • (bool|void) Whether feature was removed.
相關
  • add_theme_support()
定義位置
相關方法
_remove_theme_supportget_theme_supportremove_theme_modremove_post_type_supportrequire_if_theme_supports
引入
3.0.0
棄用
-

remove_theme_support: 這個函式用來從WordPress中刪除一個主題功能。主題功能是用來給WordPress主題新增功能的: 這個函式有一個引數,是要刪除的主題功能的名稱。

允許一個主題取消對某一功能的支援

應該在主題的 functions.php 檔案中呼叫。通常用於子主題,以覆蓋父主題的支援。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function remove_theme_support( $feature ) {
// Do not remove internal registrations that are not used directly by themes.
if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) {
return false;
}
return _remove_theme_support( $feature );
}
function remove_theme_support( $feature ) { // Do not remove internal registrations that are not used directly by themes. if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) { return false; } return _remove_theme_support( $feature ); }
function remove_theme_support( $feature ) {
	// Do not remove internal registrations that are not used directly by themes.
	if ( in_array( $feature, array( 'editor-style', 'widgets', 'menus' ), true ) ) {
		return false;
	}

	return _remove_theme_support( $feature );
}

常見問題

FAQs
檢視更多 >