What output do you get on-submit, if you add the following to the top of your sanitization callback:
var_dump( $input ); die;
i.e. add it here:
function theme_options_validate( $input ) {
var_dump( $input ); die;
Compare the results with and without TinyMCE. Let’s figure out what’s changing.
Also: this isn’t directly related to the issue you’re having (at least, I think it isn’t), but your sanitization callback doesn’t actually sanitize the input you’re sending it, i.e. client_theme_options['intro_text']
. It appears to be a conglomeration of copy-pasta, example sanitization functions.
You need to sanitize your actual option, probably with a wp_filter_post_kses()
filter, since you’re allowing for HTML input.
EDIT
Perhaps you are having a similar issue to this other SO questioner, in which the textarea data isn’t being submitted, because of the way that TinyMCE hijacks the textarea?
The solutions to that question included:
- before submit call tinyMCE.triggerSave();
- And this suggestion:
Add a hidden field to the form:
<input type="hidden" id="question_html" name="question_html" />
Before posting the form, get the data from the editor and put in the hidden field:
$('#question_html').val(tinyMCE.get('question_text').getContent());
Here’s another SO question related to the same issue. It suggests using this script code:
var editor = tinymce.get( editor_id);
editor.save(); // writes content back to the textarea
// you may now use jQuery or editor.getContent(); to acces the content
(Which I think is similar to the other suggestions.)
Not sure if any of those would be helpful?