Skip to content

Instantly share code, notes, and snippets.

View New0's full-sized avatar

Nicolas Figueira New0

View GitHub Profile
@New0
New0 / nf-custom-zapier.php
Last active April 22, 2024 16:32
Example usage of a Ninja Forms Zapier add-on filter hook for field data sent to Zapier. This can be installed as a plugin using the Download ZIP feature of this Gist interface and the Upload ZIP method in WP. This requires a precise version of the Zapier add-on. Contact Ninja Forms support if you are not sure to have the correct version.
<?php
/*
Plugin Name: Ninja Forms Custom Zapier Data
Description: Testing Ninja Forms hook
Version: 1.0.0
*/
/**
* Filter a value recorded for Zapier data. To be used with Ninja Forms Zapier >= 3.1.0
*

Keybase proof

I hereby claim:

  • I am new0 on github.
  • I am new0 (https://keybase.io/new0) on keybase.
  • I have a public key ASAOrcT-6pfoC2MhrYic5RVI4gVS-szT5aF2Jw1mrZLI3Qo

To claim this, I am signing this object:

{
"keys": [
{
"e": "AQAB",
"n": "oyny1BGtSVHw_J-FbuUB-Whk5arDFm6-fa_-HdaDP8fTFOmcLRyYdtYJXw7XvtCrupNlzDgi7QGS
D17THns2Euc88PiZsC-zKkfzhNEFiSfxickjHBWXRGWNVy8YaCzXBn1oGV63Ug8NJjCm7Enm1XXW
RZ7gMZpXMa-igI9FijOjJIOznegD3b-mtNrLlUEm07p9jaRsjDryqeRK7IQnQnVA-bPS6_VKKEq5
RHz2SilohPr2qyd3UVxhxeGsBHBy59tNfiFNW9YVXjf3cclqgnCtF1Cq_WTIt7osQPmXOn2CU-H-
2vLMpC41vptsAYRR-d-ntNZcI1x4dcoEJ004eQ",
"kid": "T_x41~crg.zmB%Kp/>~cNUml/Vs)z9WKB*ZfG7.Qj_0YK7IBs6J{0i{|IQR-GI*E",
@New0
New0 / nf-clean-processing-data.php
Created November 14, 2023 17:52
Reset the wp cron job to cleanup expired Ninja Forms nf_processing_data session entries from the options table
<?php
/**
* Plugin Name: Ninja Forms - Clean nf_processing_data
* Description: Clean the expired nf_processing_data entries from options table twice a day
* Version: 0.0.1
* Author: New0
*/
/**
* The function `delete_nf_processing_data` deletes rows from the WordPress options table where the
@New0
New0 / cf-show-pro-ui.php
Last active January 26, 2023 00:49
Show Pro settings in Caldera Forms if disconnected ( this can be activated as a WordPress plugin using the Download Zip button )
<?php
/**
* Plugin Name: CF Show Pro UI
* Description: Show Caldera Forms pro settings
* Author: Caldera Forms
**/
//Force Pro settings to show
add_filter('caldera_forms_show_pro_ui', '__return_true');
@New0
New0 / nf-custom-code.php
Last active January 2, 2023 13:59
Remove random timestamp of the name of files loaded to Dropbox or Google Drive via Ninja Forms Uploads
<?php
/*
* Plugin Name: NF custom code
* Author: New0
* Description: Insert hooks to modify Ninja Forms defaults.
*/
//Way to remove the random timestamp from filenames loaded toservices listed in the variable array
$services = ["dropbox", "google"];
@New0
New0 / nf_consent_hooks.php
Last active June 2, 2022 11:54
DRAFT used for beta testing a precise Ninja Forms Version, leave a comment if interested in testing those hooks.
@New0
New0 / jwt-whitelist-nf.php
Created April 26, 2022 10:55
Whitelist Ninja Forms routes for JWT auth plugin
<?php
/*
Plugin Name: Whitelist Ninja Forms routes
Plugin URI: https://gist.github.com/New0/7aa904c822604588f3c9066c54de8af9
Description: Whitelist Ninja Forms routes for JWT auth plugin - https://wordpress.org/plugins/jwt-auth/ -
Version: 1.0.0
Author: New0
*/
if ( ! defined( 'ABSPATH' ) ) {
@New0
New0 / cf-redirection-new-window.php
Last active March 15, 2022 08:05
Caldera Forms redirection processor using window.location to open a new window
<?php
/**
* Plugin Name: CF custom redirection
* Description: Customization for the Caldera Forms redirect processor.
* Version: 0.0.1
* Author: New0
* Author URI: https://github.com/New0
*/
add_action('caldera_forms_redirect', function($type, $url, $form){
@New0
New0 / nf-subs-management-level.php
Last active November 2, 2021 12:07
Allow editors to manage Ninja Forms > 3.6 Submissions
<?php
/**
* Filter hook used in the API route permission callback to retrieve submissions
*
* return bool as for authorized or not.
*/
add_filter( 'ninja_forms_api_allow_get_submissions', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_delete_submissions', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_update_submission', 'nf_define_permission_level', 10, 2 );
add_filter( 'ninja_forms_api_allow_handle_extra_submission', 'nf_define_permission_level', 10, 2 );