Documentation

wp-hide/interface/process

Posted in: Getting Started (4) How To (15) Plugin Options Explained (37) Actions / Filters (32)   

Name: wp-hide/interface/process
Type: Filter
Arguments: $errors, $settings, $module_settings
Returns: (array) $errors

This filter trigger when plugin admin interface is being processed. It can be used to ensure specific options are matching the requirements.

The following example checks if there’s a Theme Path in case the Child Theme Path has been filled in. If not it trigger a notice.


        add_filter('wp-hide/interface/process', 'interface_process', 10, 3);
    function interface_process( $errors, $settings, $module_settings )
        {
            global $process_interface_save_errors;
               
            //when using the 'Child - New Theme Path' trigger a warning tha the 'New Theme Path' should be changed to, to avoid relative paths issues within child styles
            
            if($settings['new_theme_path']    ==  ''  &&  $settings['new_theme_child_path'] !=  '')
                {
                    $process_interface_save_errors[]    =   array(  'type'      =>  'warning',
                                                                    'message'   =>  __('When changing the Child Theme Path it is recommended to also change the Main Theme Path to avoid relative paths issues within style files and layout break.', 'wp-hide-security-enhancer')
                                                                            );
                }
               
            return $errors;    
        }
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top