Return to Snippet

Revision: 38010
at December 22, 2010 09:12 by vagrantradio


Initial Code
add_action ('wp_print_scripts', 'my_deregister_cform', 100);

function my_deregister_cform() {

if (!is_page_template('page-contact.php')) {

        wp_deregister_script('contact-form-7');

    }

}

Initial URL


Initial Description
Prevents WordPress from loading Contact Form 7 on page templates other than the one defined.

Initial Title
Load Contact Form 7 only when needed

Initial Tags
wordpress

Initial Language
PHP