Skip to content

Instantly share code, notes, and snippets.

@Archie22is
Last active February 27, 2018 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Archie22is/8348ef1cde5683b0c4d4db13e7b7333f to your computer and use it in GitHub Desktop.
Save Archie22is/8348ef1cde5683b0c4d4db13e7b7333f to your computer and use it in GitHub Desktop.
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