TransWikia.com

wp_editor() renders outside wrapping div

WordPress Development Asked on December 9, 2020

If have a plugin with a text box. I wish to replace the text box with an editor.

My source code is

            <div id="editorwrap">
            <?php wp_editor("testing","the-editor"); ?>
            </div>

I expect that the editor will render within the div however here is the source code from the page.

The editor is right at the top of the entry-content div and my div is at the bottom of this sample.

<div class="entry-content">
        <div id="wp-the-editor-wrap" class="wp-core-ui wp-editor-wrap tmce-active"><link rel='stylesheet' id='dashicons-css'  href='https://dev.speakout.123host.net.au/wp-includes/css/dashicons.min.css?ver=5.5.1' media='all' />
<link rel='stylesheet' id='editor-buttons-css'  href='https://dev.speakout.123host.net.au/wp-includes/css/editor.min.css?ver=5.5.1' media='all' />
<div id="wp-the-editor-editor-tools" class="wp-editor-tools hide-if-no-js"><div class="wp-editor-tabs"><button type="button" id="the-editor-tmce" class="wp-switch-editor switch-tmce" data-wp-editor-id="the-editor">Visual</button>
<button type="button" id="the-editor-html" class="wp-switch-editor switch-html" data-wp-editor-id="the-editor">Text</button>
</div>
</div>
<div id="wp-the-editor-editor-container" class="wp-editor-container"><div id="qt_the-editor_toolbar" class="quicktags-toolbar"></div><textarea class="wp-editor-area" rows="20" autocomplete="off" cols="40" name="the-editor" id="the-editor">testing</textarea></div>
</div>

<div id="editorwrap"></div>

What is the trick to getting the editor inside a div in a specific position on the page, rather than at the top?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP