wp_editor() adding content as a Classic block within Gutenberg editor
-
I have a custom page created using wp_editor:
$settings = array( 'textarea_name' => 'content', 'media_buttons' => false ); wp_editor( '', 'content', $settings );
I then add the content as a post:
$post = array( 'post_title' => sanitize_text_field($_POST['title']), 'post_content' => wp_kses_post($_POST['content']), 'post_status' => 'draft', 'post_type' => 'post', ); $post_id = wp_insert_post($post);
I’ve noticed that this adds the content as a Classic block within Gutenberg. Is there a way to automatically have it converted to blocks within Gutenberg?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wp_editor() adding content as a Classic block within Gutenberg editor’ is closed to new replies.