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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 | |
// Build an array that we can use for filtering our submitted data. | |
$args = array( | |
// fields is a key in our associative array that means we're looking for field values. | |
'fields' => array( | |
// 1 represents our field id and 'Kevin' represents the value we're looking to match. | |
1 => 'Kevin', | |
// If you want to filter by multiple fields, you'd add them here. | |
// 2 => 'checked' | |
), |
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
<div class="custom-message" style="display:none;"> <!-- adding display:none; will keep the element from flashing on load. --> | |
<?php _e( 'This setting will COMPLETELY remove anything Ninja Forms related upon plugin deletion. This includes SUBMISSIONS and FORMS. It cannot be undone.', 'ninja-forms' ); ?> | |
</div> | |
<div class="custom-message-buttons" style="display:none;"> <!-- the buttons div defines the bottom of the modal.--> | |
<div id="nf-admin-modal-cancel"> <!-- nf-admin-modal-cancel is the class that aligns the button to the left. --> | |
<a class="submitdelete deletion modal-close" href="#">Cancel</a> | |
</div> | |
<div id="nf-admin-modal-update"> <!-- nf-admin-modal-update is the class that aligns the button to the right. --> | |
<a class="button-primary" href="#">Continue</a> | |
</div> |
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
/** | |
* Force the cookie expiration variant time to 23 minutes | |
* | |
* @access public | |
* @since 2.9.18 | |
* @param int $exp Default expiration (1 hour) | |
* @return int | |
*/ | |
public function set_expiration_variant_time( $exp ) { | |
return 60 * 23; |
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 if ( ! defined( 'ABSPATH' ) ) exit; | |
/** | |
* Class for our custom action type. | |
* | |
* @package Ninja Forms | |
* @subpackage Classes/Actions | |
* @copyright Copyright (c) 2014, WPNINJAS | |
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
* @since 2.8 | |
*/ |
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
/* | |
* 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
<?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 ); |
OlderNewer