Skip to content

Instantly share code, notes, and snippets.

@BFTrick
Created January 10, 2014 14:55
Show Gist options
  • Select an option

  • Save BFTrick/8355697 to your computer and use it in GitHub Desktop.

Select an option

Save BFTrick/8355697 to your computer and use it in GitHub Desktop.
Get the fields from the User Analytics Ninja Forms extension
<?php
/*
Plugin Name: Ninja Forms - Get User Analytics Fields
Plugin URI: https://gist.github.com/BFTrick/8355697
Description: Get the fields from the User Analytics Ninja Forms extension
Version: 1.0.0
Author: Patrick Rauland
Author URI: http://www.patrickrauland.com
*/
function grab_ua_fields () {
global $NF_User_Analytics;
// Make sure the $NF_User_Analytics variable is available
if ( isset( $NF_User_Analytics ) ) {
// access the get_ua_fields() method of the UA class
$ua_fields = $NF_User_Analytics->get_ua_fields();
// do whatever you need with the $ua_fields
// ...
}
}
add_action( 'init', 'grab_ua_fields', 20 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment