Documentation

Disable the CSS / JavaScript Processing ( Combine / In Place ) for specific URLs

Posted in: Getting Started (3) Plugin Options Explained (32) Actions / Filters (25) How To (11)      Code Example (10)  

The CSS and JavaScript processing modules is a powerful functionality which helps with SEO improvements and plugins/theme white-labeling. In some cases, the options are required to not trigger for specific URLs, this can be achieved using programable filters.

The following code should be placed within a file in /wp-content/mu-plugins/ folder or a custom plugin. This disable the functionality on a URL which include ‘/sample-page/’ slug.



    add_filter('wph/components/js_combine_code' ,'custom_wph_components_disable_combine');
    add_filter('wph/components/css_combine_code' , 'custom_wph_components_disable_combine');
    function custom_wph_components_disable_combine( $status )
        {
            
            $current_url    =   'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . "://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
            
            if ( stripos( $current_url, '/sample-page/') !==    FALSE )
                $status =   FALSE;
                
            return $status;   
        }

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