caldera_forms_do_magic_tag

Change the filtered value of a bracket magic tag.

Description

apply_filters( 'caldera_forms_do_magic_tag', (string) $magic_tag, (string) $magics_0_magic_key ); 

Can be used to make custom magic tags, but read https://calderaforms.com/?post_type=doc&p=40609 first

Parameters (2)

0. $magic_tag (string)
Valuye after magic parsing
1. $magics_0_magic_key (string)
The magics 0 magic key.

Usage

To run the hook, copy the example below.
  1. $magic_tag = apply_filters( 'caldera_forms_do_magic_tag', $magic_tag, $magics_0_magic_key ); 
  2.  
  3. if ( !empty( $magic_tag ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the caldera_forms_do_magic_tag callback 
  2. function filter_caldera_forms_do_magic_tag( $magic_tag, $magics_0_magic_key ) { 
  3. // make filter magic happen here... 
  4. return $magic_tag
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'caldera_forms_do_magic_tag', 'filter_caldera_forms_do_magic_tag', 10, 2 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'caldera_forms_do_magic_tag', 'filter_caldera_forms_do_magic_tag', 10, 2 ); 

Defined (1)

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

/classes/magic/doer.php  
  1. $filter_value = apply_filters( 'caldera_forms_do_magic_tag', $magic_tag, $magics[ 0 ][ $magic_key ] );