_enable_content_editor_for_navigation_post_type

函式
_enable_content_editor_for_navigation_post_type ( $post )
Access
Private
引數
  • (WP_Post) $post An instance of WP_Post class.
    Required:
相關
  • _disable_content_editor_for_navigation_post_type
定義位置
相關方法
_disable_content_editor_for_navigation_post_type_disable_block_editor_for_navigation_post_typeuse_block_editor_for_post_typeblock_core_navigation_get_post_ids_close_comments_for_old_post
引入
5.9.0
棄用
-

_enable_content_editor_for_navigation_post_type: 這個函式用於啟用導航文章型別的內容編輯器: 這是為了保持對尚未過渡到使用區塊編輯器的舊WordPress主題的向後相容性。

這個回撥可以啟用wp_navigation型別文章的內容編輯器。

我們需要重新啟用它,因為我們禁用它來隱藏wp_navigation型別文章的內容編輯器。

function _enable_content_editor_for_navigation_post_type( $post ) {
	$post_type = get_post_type( $post );
	if ( 'wp_navigation' !== $post_type ) {
		return;
	}

	add_post_type_support( $post_type, 'editor' );
}

常見問題

FAQs
檢視更多 >