cf_ajax_register_scripts

The Caldera Forms cf ajax register scripts function.

Description

cf_ajax_register_scripts( $classes, $form ); 

Parameters (2)

0. $classes
The classes.
1. $form
The form.

Usage

  1. if ( !function_exists( 'cf_ajax_register_scripts' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'caldera-forms/includes/ajax.php'; 
  3.  
  4. // The classes. 
  5. $classes = null; 
  6.  
  7. // The form. 
  8. $form = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = cf_ajax_register_scripts($classes, $form); 
  12.  

Defined (1)

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

/includes/ajax.php  
  1. function cf_ajax_register_scripts($classes, $form) { 
  2. if(empty($form['form_ajax'])) { 
  3. return $classes; 
  4.  
  5.  
  6. // enqueue scripts 
  7. wp_enqueue_script( 'cf-baldrick' ); 
  8. wp_enqueue_script( 'cf-ajax' ); 
  9.  
  10. $classes[] = 'cfajax-trigger'; 
  11.  
  12. return $classes;