get_all_post_type_supports

函式
get_all_post_type_supports ( $post_type )
引數
  • (string) $post_type The post type.
    Required:
返回值
  • (array) Post type supports list.
定義位置
相關方法
post_type_supportsget_post_types_by_supportadd_post_type_supportremove_post_type_supportget_post_type_object
引入
3.4.0
棄用
-

get_all_post_type_supports: 此函式返回所有已註冊的文章型別及其支援的功能的陣列,例如”標題”、”編輯器”和”作者”。

獲取所有的文章型別特徵

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function get_all_post_type_supports( $post_type ) {
global $_wp_post_type_features;
if ( isset( $_wp_post_type_features[ $post_type ] ) ) {
return $_wp_post_type_features[ $post_type ];
}
return array();
}
function get_all_post_type_supports( $post_type ) { global $_wp_post_type_features; if ( isset( $_wp_post_type_features[ $post_type ] ) ) { return $_wp_post_type_features[ $post_type ]; } return array(); }
function get_all_post_type_supports( $post_type ) {
	global $_wp_post_type_features;

	if ( isset( $_wp_post_type_features[ $post_type ] ) ) {
		return $_wp_post_type_features[ $post_type ];
	}

	return array();
}

常見問題

FAQs
檢視更多 >