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 | |
public function __construct() | |
{ | |
/* | |
* Required for all Extensions. | |
*/ | |
add_action( 'admin_init', array( $this, 'setup_license') ); | |
// Call our register merge tags method. |
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 | |
// Must use all three filters for this to work properly. | |
add_filter( 'ninja_forms_admin_parent_menu_capabilities', 'nf_subs_capabilities' ); // Parent Menu | |
add_filter( 'ninja_forms_admin_all_forms_capabilities', 'nf_subs_capabilities' ); // Forms Submenu | |
add_filter( 'ninja_forms_admin_submissions_capabilities', 'nf_subs_capabilities' ); // Submissions Submenu | |
function nf_subs_capabilities( $cap ) { | |
return 'edit_posts'; // EDIT: User Capability | |
} |
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
<script> | |
jQuery( document ).ready( function() { | |
//Setup our on formSumbit Listener. | |
jQuery( document ).on( 'nfFormSubmitResponse', function() { | |
//Do Stuff | |
ga('send', 'event', 'Email List', 'Subscribed', 'New Subscriber'); | |
}); | |
}); | |
</script> |
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 | |
/* | |
Plugin Name: Default Value Example | |
*/ | |
add_filter( 'ninja_forms_render_default_value', 'test', 10, 3 ); | |
function test( $default_value, $field_class, $field_settings ) | |
{ | |
if( 'textbox' == $field_settings[ 'type' ] ) { |
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 | |
/* | |
Plugin Name: Date Picker test | |
*/ | |
add_filter( 'ninja_forms_enqueue_scripts', 'nf_datepicker_options' ); | |
function nf_datepicker_options() | |
{ | |
wp_enqueue_script( 'nf_datepicker_options', plugin_dir_url( __FILE__ ) . 'script.js', array( 'jquery' ), false, true ); |
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
add_filter( 'ninja_forms_render_default_value', 'my_change_nf_default_value', 10, 3 ); | |
function my_change_nf_default_value( $default_value, $field_type, $field_settings ) { | |
if( 'your_field_key' == $field_settings[ 'key' ] ){ | |
$default_value = 'foo'; | |
} | |
return $default_value; |
NewerOlder