WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm creating a plugin that shows a frontend editor that will be the content of the current post. But I don't know who to save the content from the wp_editor to the post content;

I tried using on form action admin_url('post.php'), but I didn't work. I have been checking around but I didn't find any solution.


Here's what I have now:

function front_end_editor(){
        $settings = array(
            'wpautop' => true,
            'media_buttons' => true,
            'tinymce' => true,
            'textarea_name' => 'fe_content'
        if(is_single() || is_page()){
            echo '<form action="' . get_permalink() . '" method="get">';
            wp_editor(esc_html(get_the_content()), 'textarea_post', $settings);
            echo '<input type="hidden" name="save" value="true"/>';
            echo '<input type="submit" value="Submit" /></form>';

            if($_REQUEST['save'] == true){
                global $post;
                $post->post_content = '$_REQUEST['fe_content'];

add_action('the_content', 'front_end_editor');
share|improve this question

Use WordPress's Ajax API. like this:

    data: {
        action: 'save_post_frontend',
        content: // get your text
    method: 'POST',
    url: ajaxurl,
    success: // on success

Now save the data in wp_ajax_save_post_frontend hook. See documentation for more info.

share|improve this answer
Thanks but works with wp_insert_post() – jepser Apr 11 '12 at 21:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.