I’m trying to include wp_editor in a settings page.
public function addEditor($content = '')
{
$editor_id = 'createposteditor';
$args = array(
'textarea_rows' => 15,
'teeny' => true,
'quicktags' => false,
'editor_class' => 'createpost-editor'
);
return wp_editor( $content, $editor_id, $args );
}
and then I echo it out on the settings page:
<tr>
<td align="left" scope="row">
<h1>Add content (optional)</h1>
'. $poster->addEditor() .'
</td>
</tr>
My issue is, the editor always gets rendered at the top of the page, not from within the <td>
as I require.
As kaiser has stated, you are attempting to return the the markup for an instance of the WP Editor, but you’re using
wp_editor()
– a function that echos its output.