Support » Alpha/Beta » wp_editor() 'almost' working right

wp_editor() 'almost' working right

  • Anointed


    I have been playing around with the new 3.3beta1 and tried the improved wp_editor() on the front end of my website.

    Long story short, I am using bbPress and replaced the textarea with the editor. This works great when creating topics or replies but has a couple of issues I can’t figure out.

    If I create a post on the front end of my site using the editor in visual mode it does indeed work perfectly.

    1. If I click edit on the front end, the editor visual mode ends up showing the code instead of the images.
    2. Once I save the edited post, then the article ends up showing the code and not the images. (only happens on edit)

    3. I have guest posting enabled on the forums. For some reason if the user is not logged in, the visual tab and upload buttons are not displayed. How do I enable visual mode + uploads for everyone including guests?

    Here is the relevant snippet of code that I am using

    $post = get_post($post_id, 'OBJECT');
    $tabindex = bbp_get_tab_index();
    $settings = array(
        'wpautop' => true,
        'media_buttons' => true,
        'tabindex' => $tabindex
    wp_editor( esc_html($post->post_content), 'bbp_topic_content', $settings );

    Any help would be greatly appreciated as this is so close to working right 🙂


Viewing 7 replies - 1 through 7 (of 7 total)
  • Anointed


    removing esc_html removed the issue of the visual editor loading code.

    Still not sure about #3

    Chip Bennett


    Try using esc_textarea() instead of esc_html() in this context? You don’t want to remove escaping completely.

    Moderator Ipstenu (Mika Epstein)


    Upgrade to SVN if you can? Or Beta 2 which is due out soon. There were some more changes to this.



    I am running trunk 18999 guessing that should include changes?

    Guests still have no ability to see visual editor.
    *I have another forum topic above this one that further describes the issues I am having with the wp_editor. I can provide much more detail if needed, or even links to see the issues if it helps.

    thnx for the advice.

    Hi, I have just overcome this problem myself.

    Here’s the code that I’m using:

    $settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '25');
    wp_editor(html_entity_decode($profileuser->description), 'description', $settings);

    The html_entity_decode() function converts all HTM entities to their applicable characters.

    **EDIT – Forgot to mention, my code’s for the user biography in the user profile section. Should be the same principle, though.

    I’m trying to get the media buttons to appear for guests and not having any luck with what you’ve posted above. The code I’m using is:

    <?php $settings = array('wpautop' => true, 'media_buttons' => true, 'quicktags' => true, 'textarea_rows' => '25'); ?>
    <?php wp_editor($EM_Event->post_content, 'em-editor-content', array('textarea_name'=>'content', $settings) ); ?>

    Unless you guys are using version 3.4-aortic, please make NEW TOPICS for yourself 🙂

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘wp_editor() 'almost' working right’ is closed to new replies.