Last active
February 13, 2024 11:08
-
-
Save kjohnson/6a4d31f814c974eb8f5f618181ddde5a to your computer and use it in GitHub Desktop.
Ninja Forms Custom Merge Tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Register the new merge tag class on the `ninja_forms_loaded` hook. | |
*/ | |
add_action( 'ninja_forms_loaded', 'my_register_merge_tags' ); | |
function my_register_merge_tags(){ | |
require_once 'class.mergetags.php'; | |
Ninja_Forms()->merge_tags[ 'my_merge_tags' ] = new My_MergeTags(); | |
} |
@dcolumbus NF_Abstracts_MergeTags
is a class made available by Ninja forms plugin. You need to have the plugin installed.
Is there a way to get form_data inside the foo
callback function? For my use case, I need to replace custom tag based on other form data -- Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any idea why no matter what I do I continue to get
Fatal error: Uncaught Error: Class "NF_Abstracts_MergeTags" not found