wpcf7_enqueue_scripts

The Contact Form 7 wpcf7 enqueue scripts function.

Description

wpcf7_enqueue_scripts(); 

Usage

  1. if ( !function_exists( 'wpcf7_enqueue_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/includes/controller.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wpcf7_enqueue_scripts(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/controller.php  
  1. function wpcf7_enqueue_scripts() { 
  2. // jquery.form.js originally bundled with WordPress is out of date and deprecated 
  3. // so we need to deregister it and re-register the latest one 
  4. wp_deregister_script( 'jquery-form' ); 
  5. wp_register_script( 'jquery-form',  
  6. wpcf7_plugin_url( 'includes/js/jquery.form.min.js' ),  
  7. array( 'jquery' ), '3.51.0-2014.06.20', true ); 
  8.  
  9. $in_footer = true; 
  10.  
  11. if ( 'header' === wpcf7_load_js() ) { 
  12. $in_footer = false; 
  13.  
  14. wp_enqueue_script( 'contact-form-7',  
  15. wpcf7_plugin_url( 'includes/js/scripts.js' ),  
  16. array( 'jquery', 'jquery-form' ), WPCF7_VERSION, $in_footer ); 
  17.  
  18. $_wpcf7 = array( 
  19. 'recaptcha' => array( 
  20. 'messages' => array( 
  21. 'empty' => 
  22. __( 'Please verify that you are not a robot.', 'contact-form-7' ),  
  23. ),  
  24. ),  
  25. ); 
  26.  
  27. if ( defined( 'WP_CACHE' ) && WP_CACHE ) { 
  28. $_wpcf7['cached'] = 1; 
  29.  
  30. $_wpcf7['jqueryUi'] = 1; 
  31.  
  32. wp_localize_script( 'contact-form-7', '_wpcf7', $_wpcf7 ); 
  33.  
  34. do_action( 'wpcf7_enqueue_scripts' );