wpcf7_add_tag_generator

The Contact Form 7 wpcf7 add tag generator function.

Description

wpcf7_add_tag_generator( (string) $name, $title, $elm_id, $callback, (array) $options = array() ); 

Parameters (5)

0. $name (string)
The name.
1. $title
The title.
2. $elm_id
The elm id.
3. $callback
The callback.
4. $options — Optional. (array) => array()
The options.

Usage

  1. if ( !function_exists( 'wpcf7_add_tag_generator' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'contact-form-7/admin/includes/admin-functions.php'; 
  3.  
  4. // The name. 
  5. $name = ''; 
  6.  
  7. // The title. 
  8. $title = null; 
  9.  
  10. // The elm id. 
  11. $elm_id = null; 
  12.  
  13. // The callback. 
  14. $callback = null; 
  15.  
  16. // The options. 
  17. $options = array(); 
  18.  
  19. // NOTICE! Understand what this does before running. 
  20. $result = wpcf7_add_tag_generator($name, $title, $elm_id, $callback, $options); 
  21.  

Defined (1)

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

/admin/includes/admin-functions.php  
  1. function wpcf7_add_tag_generator( $name, $title, $elm_id, $callback, $options = array() ) { 
  2. $tag_generator = WPCF7_TagGenerator::get_instance(); 
  3. return $tag_generator->add( $name, $title, $callback, $options );