Documentation

wph/components/force_run_on_admin

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: wph/components/force_run_on_admin
Type: Filter
Arguments:
(bool) $status
(string) $component_id

By default, certain features will not run on the Dashboard to preserve the breaking of certain functionality. This filter can be used to force modules to run on the admin dashboard too.


    add_filter('wph/components/force_run_on_admin', 'custom_wph_components_force_run_on_admin', 10, 2);
    function custom_wph_components_force_run_on_admin( $status, $component_id )
        {
            
            return TRUE;   
        }

The following sample code activate the Text Replace function on dashboard too:


    add_filter('wph/components/force_run_on_admin', 'custom_wph_components_force_run_on_admin', 10, 2);
    function custom_wph_components_force_run_on_admin( $status, $component_id )
        {
            if ( $component_id == 'text_replace' )    
                return TRUE;   
                
            return $status;
        } 

Important!
The above code should be placed within wp-content/mu-plugins/ directory, the file should include a underline ( _ ) char as first letter, to ensure is being loaded before WP Hide Loader module.

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