• Resolved n0ddles

    (@n0ddles)


    I’m having an issue with my ninjaforms CSS map files not loading on a page. So I’m trying to disable all optimisations for the page, I’ve tried the following but the page still runs with FVM enabled.

    I got this from a previous page on support, has something changed recently?

    function disable_fvm_functionality() {
    if( is_page( 28129 ) ) {
    			remove_action('wp_print_scripts', 'fastvelocity_min_merge_header_scripts', PHP_INT_MAX );
    			remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_scripts', PHP_INT_MAX);
    			remove_action('wp_print_styles', 'fastvelocity_min_merge_header_css', PHP_INT_MAX );
    			remove_action('wp_print_footer_scripts', 'fastvelocity_min_merge_footer_css', PHP_INT_MAX);
    			remove_action('wp_print_styles', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX);
    			remove_action('wp_print_footer_scripts', 'fastvelocity_add_google_fonts_merged', PHP_INT_MAX );
    			remove_action('init', 'fastvelocity_min_disable_wp_emojicons', PHP_INT_MAX);
    			remove_action('template_redirect', 'fastvelocity_min_html_compression_start', PHP_INT_MAX);
    			remove_filter('style_loader_src', 'fastvelocity_remove_cssjs_ver', PHP_INT_MAX);
    			remove_filter('script_loader_tag', 'fastvelocity_min_defer_js', PHP_INT_MAX);
    			remove_action('wp_footer', 'fvm_add_loadcss', PHP_INT_MAX);
    			remove_action('admin_enqueue_scripts', 'fastvelocity_min_load_admin_jscss', PHP_INT_MAX);
    			remove_action('style_loader_tag', 'fastvelocity_optimizecss', PHP_INT_MAX);
        }
    }
    add_action('template_redirect', 'disable_fvm_functionality');
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Raul P.

    (@alignak)

    After the upgrade to version 3, you should only need this:

    add_action('template_redirect', 'disable_fvm_functionality');
    function disable_fvm_functionality() {
    	if( is_page( 28129 ) ) {
    		remove_action('template_redirect', 'fvm_start_buffer', -PHP_INT_MAX); 
    	}
    }

    That code was for version 2 of the plugin.

    Thread Starter n0ddles

    (@n0ddles)

    Cheers Raul, will try that instead!

    Plugin Author Raul P.

    (@alignak)

    For future reference, there was an error on my sample code.

    The action must be defined earlier, either on wp_loaded or init for example, ex:

    add_action('wp_loaded', 'disable_fvm_functionality');
    function disable_fvm_functionality() {
    	if( is_page( 28129 ) ) {
    		remove_action('template_redirect', 'fvm_start_buffer', -PHP_INT_MAX); 
    	}
    }
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disabling on specific page’ is closed to new replies.