wpseek.com
Uma área de pesquisa sobre o WordPress para devs e autores do tema



_disable_content_editor_for_navigation_post_type › WordPress Function

Desde5.9.0
Obsoleton/a
_disable_content_editor_for_navigation_post_type ( $post )
Acesso:
  • private
Parâmetros:
  • (WP_Post) $post An instance of WP_Post class.
    Required: Yes
Definido em:
Codex:

This callback disables the content editor for wp_navigation type posts.

Content editor cannot handle wp_navigation type posts correctly. We cannot disable the "editor" feature in the wp_navigation's CPT definition because it disables the ability to save navigation blocks via REST API.


Fonte

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

	remove_post_type_support( $post_type, 'editor' );
}