I have created a custom settings page with a couple of wp_editor()
calls on it.
When I enter some text in the editor, and format it (e.g. make it bold), and then save it, the value is saved in the database. If I reload the settings page again, it loads the text in the editor as bold.
However, when I load the options on a page, and echo it, it has no html tags what so ever.
I have not added any sanitation, and it would seem that it knows it is bold, because it works when loading the settings page.
Does anyone know how I can get it to not strip away html tags when printing the value from the editor field?
This is how I print it:
$options = get_option('settings');
echo $options['information'];
EDIT:
This is how I create the wp_editor
:
<?php wp_editor( $options['text'], 'text', array(
'textarea_name' => 'settings[text]',
'media_buttons' => false,
'textarea_rows' => 10
)); ?>
It saves it automatically when I click the form submit button. That is created like this:
function settings_page() {
if (!current_user_can('manage_options')) {
wp_die(__('You do not have sufficient permissions to access this page.', 'test'));
}
?>
<div class="wrap">
<?php screen_icon(); ?> <h2><?php _e('Settings', 'test'); ?></h2>
<form method="post" action="options.php">
<?php settings_fields( 'settings' ); ?>
<?php do_settings_sections( 'settings-page' ); ?>
<?php submit_button(); ?>
</form>
</div>
<?php
}