_disable_content_editor_for_navigation_post_type()
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.
Внутренняя функция — эта функция рассчитана на использование самим ядром. Не рекомендуется использовать эту функцию в своем коде.
Хуков нет.
Возвращает
null. Ничего (null).
Использование
_disable_content_editor_for_navigation_post_type( $post );
- $post(WP_Post) (обязательный)
- An instance of WP_Post class.
Список изменений
| С версии 5.9.0 | Введена. |
Код _disable_content_editor_for_navigation_post_type() disable content editor for navigation post type WP 7.1
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' );
}