remove_post_type_support

函式
remove_post_type_support ( $post_type, $feature )
引數
  • (string) $post_type The post type for which to remove the feature.
    Required:
  • (string) $feature The feature being removed.
    Required:
定義位置
相關方法
post_type_supportsadd_post_type_supportget_post_types_by_supportremove_theme_supportget_all_post_type_supports
引入
3.0.0
棄用
-

remove_post_type_support: 這個函式用來刪除對一個自定義文章型別的特定功能的支援。自定義文章型別是用來在WordPress中建立不同型別的文章的: 這個函式需要兩個引數:自定義文章型別的名稱和要刪除的功能的名稱。

從文章型別中刪除對某項功能的支援。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function remove_post_type_support( $post_type, $feature ) {
global $_wp_post_type_features;
unset( $_wp_post_type_features[ $post_type ][ $feature ] );
}
function remove_post_type_support( $post_type, $feature ) { global $_wp_post_type_features; unset( $_wp_post_type_features[ $post_type ][ $feature ] ); }
function remove_post_type_support( $post_type, $feature ) {
	global $_wp_post_type_features;

	unset( $_wp_post_type_features[ $post_type ][ $feature ] );
}

常見問題

FAQs
檢視更多 >