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 | |
add_action( 'ninja_forms_pre_process' , 'sn_add_date_to_submission' , 10 ); | |
function sn_add_date_to_submission(){ | |
global $ninja_forms_processing; | |
$ninja_forms_processing->update_field_value( 9 , current_time( 'm-d-Y' ) ); |
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 nf_change_csv_name( $filename ) { | |
$filename = 'nameyourfilehere'; | |
return $filename; | |
} | |
add_filter( 'nf_subs_csv_filename', 'nf_change_csv_name' ); |
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
var array = ["2014-12-24","2014-12-25", | |
"2015-07-04","2015-11-26","2015-12-24","2015-12-25", | |
"2016-07-04","2016-11-24","2016-12-24","2016-12-25", | |
"2017-07-04","2017-11-23","2017-12-24","2017-12-25", | |
"2018-07-04","2018-11-22","2018-12-24","2018-12-25", | |
"2019-07-04","2019-11-28","2019-12-24","2019-12-25", | |
"2020-07-04","2020-11-26","2020-12-24","2020-12-25", | |
"2021-07-04","2021-11-25","2021-12-24","2021-12-25", | |
"2022-07-04","2022-11-24","2022-12-24","2022-12-25", | |
"2023-07-04","2023-11-23","2023-12-24","2023-12-25", |
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: Example Plugin | |
*/ | |
<?php | |
function my_ninja_forms_date_code(){ | |
//Declare $ninja_forms_processing as a global variable. | |
global $ninja_forms_processing; | |
//only process this code on the form ID 1 | |
$form_id = $ninja_forms_processing->get_form_ID(); |
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 custom_nf_verify_email_domain(){ | |
global $ninja_forms_processing; | |
// Gets the ID of the form we are currently processing. | |
$form_id = $ninja_forms_processing->get_form_ID(); | |
if ($form_id == 13) { | |
// Get the user submitted value for the field with an ID of 55. | |
$submitted_email = $ninja_forms_processing->get_field_value( 55 ); | |
// Set the allowed domain that we will accept. | |
$approved_email = '@gmail.com'; |
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 example_disable_newsletter_signup( $form_id ) { | |
global $ninja_forms_processing; | |
$form_id = $ninja_forms_processing->get_form_ID(); | |
if ( $form_id == 1 ) { | |
$opt_in = $ninja_forms_processing->get_field_value( 23 ); | |
if ( $opt_in == 'unchecked' ) { | |
$ninja_forms_processing->update_form_setting( 'constant_contact_signup_form', false ); | |
} |
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
if (!-e $request_filename) | |
{ rewrite ^(.*)$ /index.php?q=$1 last; break; | |
} | |
location ~ \.css { | |
add_header Content-Type text/css; | |
} | |
location ~ \.js { | |
add_header Content-Type application/x-javascript; | |
} |
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 | |
/* | |
Template Name: Ticket Consignment Standard | |
*/ | |
get_header(); ?> | |
<?php if ( have_posts() ) : ?> | |
<form role="search" method="get" class="searchform" action="<?php echo home_url( '/' ); ?>"> | |
<input type="text" name="s" id="s" value="Search for tickets" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" /> | |
<input type="hidden" name="post_type" value="ticket" /> |
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
<!--1. Documentation should include the simplest, most concise way for a new user to run your addon successfully. --> | |
<!--2. Use the simplest use case possible for each feature, broken down into easy to digest steps. --> | |
<!--3. As a general rule of thumb, no more than two mouse clicks should take place in each distinct step (a choice and save/action, for example).--> | |
<!--4. If you plugin can handle fringe, advanced use cases you may document these in an "Advanced" section after the simple setup.--> | |
<!--5. Every single option, filter, or shortcode in your plugin should be documented at the END of the documentation, after the simple set up. --> | |
<!-- -You may reference it in the above docs and create an anchor link to your definition, but do not expound on them in the body.--> | |
<a name="top"></a> | |
<ul> |
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
var PHPUnserialize = require('php-unserialize'); | |
var mysql = require('mysql'); | |
connection.query('SELECT * FROM wp_ninja_forms where id =2', function(err, rows, fields) { | |
if (err) throw err; | |
//console.log('The solution is: ', rows[0].solution); | |
for (var i in rows) { | |
console.log(rows[i].data); | |
var formObject = PHPUnserialize.unserialize(rows[i].data); | |
console.log(formObject); |