Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes, it does work.

    Let’s see if this is the final fix for the plugin from the author, or maybe he’ll make another workaround.
    But meanwhile, it’s working.
    Thanks!

    Thread Starter jumbo

    (@jumbo)

    Hi RXC,

    I’ve been using the following in wp-config.php:

    define('WPCF7_LOAD_JS', false);
    define('WPCF7_LOAD_CSS', false);

    and the following within functions.php (not the contact form template):

    function enqueue_contact7_scripts()
    {
        if (function_exists('wpcf7_enqueue_scripts')) {
            wpcf7_enqueue_scripts();
        }
    }
    add_action('wp_enqueue_scripts', 'enqueue_contact7_scripts');

    The above stopped working with v3.9. The code in the FAQ specifies using it in the contact form template, but since I have multiple Contact Form 7 pages I placed the code above in functions.php instead.

    Anyway, the new ‘wpcf7_load_js’ filter (introduced in v3.9) does work (in functions.php), so I’m good to go for now. I just wanted to post this topic for the author’s information in case an inconsistency crept through.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Loading JavaSCript only when necessary no longer works’ is closed to new replies.