I'm trying to add the MU Site Name to Merge Tags drop down.
I found the "Gform merge tags" documentation and using that, I added to functions.php
snippet:
gform.addFilter("gform_merge_tags", "add_merge_tags");
function add_merge_tags(mergeTags, elementId, hideAllFields, excludeFieldTypes, isPrepop, option){
mergeTags["custom"].tags.push({ tag: '{site_name}', label: 'Site Name' });
return mergeTags;
I now see the custom merge tag: "Site Name" in the Merge Tag dropdown but don't see how to assign that tag to the actual site name. I can get the site name using:
//get MU site name
global $blog_id;
$local_site_name = get_blog_details( array( 'blog_id' => $blog_id ) );
I'm thinking that the above just adds the tag to the list but somewhere else the content gets assigned to the tag label. ( The docs could be a bit clearer on this subject! )
Any help would be appreciated!