• Resolved danbrellis

    (@danbrellis)


    Unlinke most wp_editor related questions, thsi doesn’t have to do with the post content.

    I am using a router to show a form on a page on the frontend. On this page, my function calls:

    $settings = array(
     'wpautop' => true,
     'media_buttons' => false,
     'editor_class' => 'frontend',
     'textarea_rows' => 5,
     'tabindex' => 2,
    );
    
    wp_editor( stripslashes( $post->post_content ), 'cnpostcontent', $settings );

    It works fine except that there is a
    in between the two buttons to toggle Visual and Text:

    <div id="wp-cnpostcontent-editor-tools" class="wp-editor-tools hide-if-no-js"><a id="cnpostcontent-html" class="wp-switch-editor switch-html" onclick="switchEditors.switchto(this);">Text</a><br>
    <a id="cnpostcontent-tmce" class="wp-switch-editor switch-tmce" onclick="switchEditors.switchto(this);">Visual</a>
    </div>

    This causes the Visual button to jump down. I can use css to raise it up with a negative margin, but I have no idea why it’s doing this. I’m not hooking this into the_content filter.

    Any thoughts would be appreciated.

    Thanks.

Viewing 1 replies (of 1 total)
  • Thread Starter danbrellis

    (@danbrellis)

    Update.

    Resolved.

    I removed this by adding the following code in my router callback function.

    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_content', 'wptexturize' );

    Apparently wp still uses the content hook.

Viewing 1 replies (of 1 total)
  • The topic ‘Line break added in wp_editor code’ is closed to new replies.