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 | |
function my_custom_nf_action( $types ) { | |
$types['my_action'] = PATH_TO_MY_ACTION_CLASS_FILE; | |
return $types; | |
} | |
add_filter( 'nf_notification_types', 'my_custom_nf_action' ); |
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 | |
function bust_godaddy_caching( $url, $form_id ) { | |
$new_url = add_query_arg( array( 'nocache' => 1 ), $url ); | |
return $new_url; | |
} | |
add_filter( 'ninja_forms_ajax_url', 'bust_godaddy_caching', 10, 2 ); |
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 | |
function ninja_forms_custom_display( $form_id ) { | |
// Output text received from the database before our field output. | |
$text = get_stuff_from_somewhere_else( $form_id ); | |
echo '<h4>'. $text . '</h4>'; | |
} | |
add_action( 'ninja_forms_display_before_form', 'ninja_forms_custom_display' ); |
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 | |
function ninja_forms_custom_display( $before_fields, $form_id ) { | |
// Output text received from the database before our field output. | |
$text = get_stuff_from_somewhere_else( $form_id ); | |
$before_fields .= '<h4>'. $text . '</h4>'; | |
return $before_fields; | |
} | |
add_filter( 'nf_frontend_before_form', 'ninja_forms_custom_display', 10, 2 ); |
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
/* | |
* This variable holds all of our custom strings for form display. | |
* It can be accessed and used by our JS code. | |
*/ | |
var nfDynamicContent = { | |
beforeForm: '', | |
beforeFields: '<h4>Please check your fields carefully!</h4>', | |
afterFields: '', | |
afterForm: '' | |
} |
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
this.collection = new fieldTypeCollection( [ | |
{ | |
id: 'textbox', | |
nicename: 'Textbox', | |
alias: [ 'input' ], | |
parentType: '', | |
settingGroups: new fieldTypeSettingGroupCollection( [ | |
{ | |
name: '', | |
display: 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
/** | |
* Work around for Require, Radio, and WordPress. | |
* | |
* Returns the WordPress-loaded version of Backbone for use with things that need it and use Require. | |
* | |
* @since 3.0 | |
* @return Object Backbone Object | |
*/ | |
define( function() { | |
return Backbone; |
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
/** | |
* Work around for Require, Radio, and WordPress. | |
* | |
* Returns the WordPress-loaded version of Underscore for use with things that need it and use Require. | |
* | |
* @since 3.0 | |
* @return Object Underscore Object | |
*/ | |
define( function() { | |
return _; |
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
jQuery( document ).ready( function( $ ) { | |
/** | |
* JS goes here | |
*/ | |
} ); |
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
// Create a new object for custom validation of a custom field. | |
var mySubmitController = Marionette.Object.extend( { | |
initialize: function() { | |
this.listenTo( Backbone.Radio.channel( 'field-4', 'change:field', this.nameChange ) ); | |
}, | |
nameChange: function( el, model ) { | |
// Split your model value | |
var value = model.get( 'value' ); |