This file contains hidden or 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('.datepicker').datepicker({ | |
| // Show the 'close' and 'today' buttons | |
| showButtonPanel: true, | |
| closeText: objectL10n.closeText, | |
| currentText: objectL10n.currentText, | |
| monthNames: objectL10n.monthNames, | |
| monthNamesShort: objectL10n.monthNamesShort, | |
| dayNames: objectL10n.dayNames, | |
| dayNamesShort: objectL10n.dayNamesShort, | |
| dayNamesMin: objectL10n.dayNamesMin, |
This file contains hidden or 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
| var gulp = require('gulp'); | |
| var rename = require('gulp-rename'); | |
| var uglify = require('gulp-uglify'); | |
| gulp.task('js', function () { | |
| return gulp.src('assets/js/**/*.js') //select all javascript files under js/ and any subdirectory | |
| .pipe(uglify()) | |
| .pipe(rename({ suffix: '.min' })) | |
| .pipe(gulp.dest('assets/js/')); //the destination folder | |
| }); |
This file contains hidden or 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
| class Test { | |
| public $var; | |
| public function get_var() { | |
| return $this->var = "Hello, world!"; | |
| } | |
| } | |
| $test = new Test(); |
This file contains hidden or 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
| class test { | |
| const HELLO = 'Hello'; | |
| } | |
| class test1 extends test { | |
| const HELLO = 'Hello, test1'; | |
| } | |
| class test2 extends test { | |
| const HELLO = 'Hello, test2'; | |
| } |
This file contains hidden or 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 | |
| add_filter( 'ninja_forms_submission_csv_name', 'my_unique_csv_name', 10, 1 ); | |
| function my_unique_csv_name( $csv_name ) { | |
| global $ninja_forms_processing; | |
| return $ninja_forms_processing->get_form_setting( 'sub_id' ). "_" . $csv_name; | |
| } |
This file contains hidden or 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( 'nf_upgrade_handler_register', 'add_nf_my_upgrade', 10, 1 ); | |
| function add_nf_my_upgrade( $upgrades ) { | |
| $upgrades[] = new NF_Upgrade_My_UPgrade(); | |
| return $upgrades; | |
| } |
This file contains hidden or 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() { | |
| jQuery.datepicker.setDefaults( | |
| { | |
| closeText: 'Close', | |
| prevText: 'Previous', | |
| nextText: 'Next', | |
| currentText: 'Today' | |
| // Add other options as needed | |
| } | |
| ); |
This file contains hidden or 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($) { | |
| // Display Field ID next to Field Title | |
| $(".ninja-forms-field-title").each( function() { | |
| var obj_id = this.id; | |
| var temp_array = obj_id.split( '_' ); | |
| var id = temp_array[ temp_array.length - 2 ]; | |
| var html = $( this ).html(); |
This file contains hidden or 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
| class CPT_Example { | |
| public function __construct() { | |
| add_action( 'init', array( $this, 'custom_post_type' ), 0 ); | |
| add_action('add_meta_boxes', array( $this, 'ninja_forms_add_custom_box' ) ); | |
| } | |
| public function custom_post_type() { | |
| //Source: http://generatewp.com/post-type/ | |
| $labels = array( | |
| 'name' => _x( 'Examples', 'Post Type General Name', 'text_domain' ), |
This file contains hidden or 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 |