Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

http://stackoverflow.com/questions/14802251/hook-into-the-wordpress-theme-customizer-save-action show me i can save settings of the Theme Customizer to a file. Like:

//http://stackoverflow.com/questions/14802251/hook-into-the-wordpress-theme-customizer-save-action
add_action( 'customize_save_after', 'save_css',10);
function save_css($c)
{

        $values = json_decode( wp_unslash( $_POST['customized'] ), true );

        if($values['default_grid']=='xs')
        {
            $fp = fopen(get_template_directory().'/css/custom.css', 'w+');
            fwrite($fp, '.xs{width:100%;}'."\n");
            fclose($fp);
        }
        exit;
}

This will work if the file exists and is writable. Now i want show the user an error when the file is not writable. So how do i show an error to the user in the Theme Customizer? (from the save_css function)

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.