CF Conditional fields load scripts when CF7 not loaded
-
Sorry to bug you again, but I was wondering if you can change your enqueue scripts to require CF7 to also be a requirement before loading?
So change
wp_enqueue_script('wpcf7cf-scripts', plugins_url('js/scripts.js', __FILE__), array('jquery'), WPCF7CF_VERSION, true); wp_enqueue_style('cf7cf-style', plugins_url('style.css', __FILE__), array(), WPCF7CF_VERSION);' towp_enqueue_script(‘wpcf7cf-scripts’, plugins_url(‘js/scripts.js’, __FILE__), array(‘jquery’, ‘contact-form-7’), WPCF7CF_VERSION, true);
wp_enqueue_style(‘cf7cf-style’, plugins_url(‘style.css’, __FILE__), array(‘contact-form-7’), WPCF7CF_VERSION);`
That way we can have CF7 & all related plugins only load on form pages and not the whole website, using CF7’s removal method.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘CF Conditional fields load scripts when CF7 not loaded’ is closed to new replies.