_disable_block_editor_for_navigation_post_type

函式
_disable_block_editor_for_navigation_post_type ( $value, $post_type )
Access
Private
引數
  • (bool) $value Whether the CPT supports block editor or not.
    Required:
  • (string) $post_type Post type.
    Required:
返回值
  • (bool) Whether the block editor should be disabled or not.
定義位置
相關方法
_disable_content_editor_for_navigation_post_type_enable_content_editor_for_navigation_post_typeuse_block_editor_for_post_typeuse_block_editor_for_postblock_core_navigation_get_post_ids
引入
5.9.0
棄用
-

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

禁用wp_navigation型別文章的區塊編輯器,以便可以通過使用者介面管理它們。

function _disable_block_editor_for_navigation_post_type( $value, $post_type ) {
	if ( 'wp_navigation' === $post_type ) {
		return false;
	}

	return $value;
}

常見問題

FAQs
檢視更多 >