Skip to content

Instantly share code, notes, and snippets.

@Archie22is Archie22is/functions.php
Last active Feb 27, 2018

Embed
What would you like to do?
Adding custom tags to WPForms
/**
* WPForms Custom Smart Tags
* The following code will turn {my_smart_tag} into “Testing 1 2 3”.
* You can replace the tag name and value with whatever you’d like to use.
*
* @author Bill Erickson
* @see http://www.billerickson.net/code/wpforms-custom-smart-tags
*/
function ea_custom_smart_tags( $content, $tag ) {
if( 'you_password' == $tag ) {
$value = 'Testing 1 2 3';
$content = str_replace( '{' . $tag . '}', $value, $content );
}
return $content;
}
add_filter( 'wpforms_smart_tag_process', 'ea_custom_smart_tags', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.