Documentation

wp-hide/interface/process/reserved_values

Posted in: Getting Started (4) How To (15) Plugin Options Explained (37) Actions / Filters (31)      Code Example (16)  

This functionality is available for PRO version.

Name: wp-hide/interface/process/reserved_values
Type: Filter
Arguments:
(array) $reserved_values

Through the filter, the system reserved values can be changed, by add or remove specific slugs. A reserved_value item can contain regex patterns e.g. [^\w\-]wp[^\w\-]

The following example add a new system reserved slug as “clear“.


    add_filter ( 'wp-hide/interface/process/reserved_values', '__wp_hide_interface_process_reserved_values');
    function __wp_hide_interface_process_reserved_values ( $reserved_values )
        {
            
            $reserved_values[]   =   '[^\w\-]clear[^\w\-]';
                
            return $reserved_values;
        }

Preexistent reserved values can be also removed from the array:


    add_filter ( 'wp-hide/interface/process/reserved_values', '__wp_hide_interface_process_reserved_values');
    function __wp_hide_interface_process_reserved_values ( $reserved_values )
        {
            
            foreach ( $reserved_values  as  $key    =>  $value )
                {
                    if ( strpos( $value, 'dashboard' )  !== FALSE )
                        unset ( $reserved_values[$key] );
                }
                
            return $reserved_values;
        }

Important!
The above code should be placed within wp-content/mu-plugins/ directory.

Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn
Scroll to top