I'm looking to add a wp_editor() input to my WordPress plugin settings page. I've followed the codex instructions and have run across a problem.
When I comment out the wp_editor line below, the textarea saves content properly and auto-populates the field on page reload.
But, when I comment out the $html = '' line, the wp_editor saves content properly, but DOES NOT auto-populate the field on page reload.
$output = $args[0].'[content]';
$value = isset( $args[1]['content'] ) ? $args[1]['content'] : '';
$id = $args[0].'_content';
$settings = array(
'textarea_name' => $output,
'textarea_rows' => '5'
);
wp_editor( $value, $id, $settings );
$html = '<textarea id="' .$output. '" name="' .$output. '" rows="6" style="width: 90%; padding: 10px;" type="textarea">' .$value. '</textarea>';
$html .= '<p class="description">' . __( 'Enter default content to be displayed within the WYSIWYG editor, such as "delete this, then start writing". HTML and shortcodes allowed.', $this->plugin_slug ) . '</p><br />';
echo $html;
My question is, what is happening here? Does the wp_editor() need something extra from me so it can recognize content associated with it and populate the editor when the page loads?
Even if I set $value = 'Hello World!'; I get the same result.
Any help is much appreciated.