Documentation

wp-hide/module/general_js_combine/placeholders_process/element_content

Posted in: Getting Started (4) Plugin Options Explained (33) Actions / Filters (27) How To (12)      Module (8)    Code Example (13)  

This functionality is available for PRO version.

Name: wp-hide/module/general_js_combine/placeholders_process/element_content
Type: Filter
Arguments:
(text) $element_content
(text) $local_file_path

This filter can be used to make changes on a JavaScript file content before being processed by module.


    add_filter( 'wp-hide/module/general_js_combine/placeholders_process/element_content', 'wp_hide_module_general_js_combine_placeholders_process_element_content', 10, 2 );
    function wp_hide_module_general_js_combine_placeholders_process_element_content( $file_content, $file_path ) 
        {
            $replacements_list  =   array(
                                            'martfury-product-deals-carousel.default'       =>  'freemium-product-deals-carousel.default',
                                            'martfury-slides.default'                       =>  'freemium-slides.default'
                                            );
            
            $replace        =   array_keys($replacements_list);
            $replacements   =   array_values($replacements_list);
            
            $file_content   =   str_ireplace( $replace, $replacements, $file_content );
            
            return $file_content;
            
        }

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