How to edit posts with the new wp_editor api?

For the sake of completeness, I am going to post an answer based on the solution you edited in your question.

$post = get_post( $post_id, 'OBJECT' );
wp_editor( esc_html( $post->post_content ), 'textarea01', $settings );

This would escape the HTML too so if you are editing a post you might want to replace the last line with:

wp_editor( $post->post_content, 'textarea01', $settings );

Leave a Comment