i'm trying to add wp_editor() to my theme-option page but it is not saved when html is decoded.

so this is the issue:

in the theme option page i successfully added a new option called login_block_login_text. usually i'd add this option as an array, but i wanted it to be a tinymce editor and not textarea so this is what i did:

$editor_args = array(
    'textarea_name' => 'tie_options[login_block_login_text]'
$content = tie_get_option('login_block_login_text');
wp_editor( $content, 'login_block_login_text', $editor_args); 

now the option is saved, but after refresh it is printed html encoded. this is the pre-saving encoding function for ALL theme options, which i guess causes it:

function tie_clean_options(&$value) {
     $value = htmlspecialchars(stripslashes($value));

BUT: if i add htmlspecialchars_decode to the first code, the option won't save at all. like this:

wp_editor( htmlspecialchars_decode($content), 'login_block_login_text', $editor_args); 

Thank you very much,


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.