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 | |
// Based on https://calderaforms.com/doc/caldera_forms_admin_csv/ | |
add_filter( 'caldera_forms_admin_csv', function( $csv_data, $form ){ | |
//IMPORTANT change form ID to match your form | |
if( 'CF5eb5616ea264f' === $form[ 'ID' ] ){ | |
//Add a header for new column | |
$csv_data[ 'headers' ] = ['entry_id' => 'Entry ID'] + $csv_data[ 'headers' ]; | |
//Add a value for each row for this new column |
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 | |
//EDIT easy_pods_name with the correct name of the easy pods | |
add_filter('the_content', function($content) { | |
// Check if we're inside the post 661 | |
if ( get_the_ID() === 661 ) { | |
return $content . cep_render_easy_pod( 'easy_pods_name' ); | |
} | |
return $content; |
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 | |
/** Hook in when custom fields are saved by CF Custom fields to write entry ID as user meta */ | |
add_action( 'cf_custom_fields_post_save_meta_key_to_post_type', function($value, $slug, $post_id, $field, $form){ | |
if( $slug === "meta_post_id" ){ | |
if( $value === $post_id){ | |
return; | |
} else { | |
update_user_meta( get_current_user_id(), "meta_post_id", $post_id ); | |
} | |
} |
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
A regular Form | |
[caldera_form id="CF54ce83dd431a1"] | |
A Form that will open as a Modal, formatted as a link taking the name of the Form as text. | |
[caldera_form_modal id="CF54ce83dd431a1"] | |
A Form that will open as a Modal, formatted as a button with text defined in the shortcode | |
[caldera_form_modal id="CF54ce83dd431a1" type="button"]Open Form[/caldera_form_modal] |
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 | |
namespace App\Console\Commands; | |
use App\Message; | |
use Carbon\Carbon; | |
use Illuminate\Console\Command; | |
class RecentlyUsedAccounts extends Command | |
{ | |
/** |
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
SELECT DISTINCT | |
account | |
FROM | |
messages t | |
WHERE | |
t.created_at >= DATE_SUB(NOW(), INTERVAL 30 DAY) and t.created_at < NOW() |
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
SELECT DISTINCT | |
account | |
FROM | |
messages t | |
WHERE | |
t.created_at BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) and NOW() |
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 | |
/** | |
* 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 ); |
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 | |
/* | |
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' ) ) { |
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 | |
/** | |
* Plugin Name: Ninja Forms consent hooks example | |
* Description: Example use of the nf_consent_status_check and nf_consent_link JS events that help integrate custom consent check and activation into Ninja Forms. | |
* Version: 0.0.1 | |
* Author: Nicolas Figueira | |
* Author URI: https://newo.me | |
*/ | |
add_action("wp_footer", function() { ?> |