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
<?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
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 | |
/** 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
<?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 | |
// 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 | |
add_filter( 'caldera_forms_field_attributes', function( $attrs, $field ){ | |
//EDIT FIELD ID | |
if( $field['ID'] === "fld_7194486" ){ | |
$attrs[ 'min' ] = date("Y-m-d"); | |
} | |
return $attrs; |
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: Caldera Forms manage Stripe cancelation | |
* Description: Dispay a link that resets the form when returning from Stripe cancellation. | |
* Plugin URL: https://gist.github.com/New0/65b1b0dc194c23703e935a0fc22268a1 | |
* Author: New0 | |
*/ | |
add_filter( 'caldera_forms_pre_render_form', function( $html, $entry_id, $form ){ | |
//Check if we come back from Stripe with cancelled status |
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: Stripe session transients duration | |
* Description: Customize duration for Form entries to be stored. | |
* Author: New0 | |
* | |
*/ | |
//Set the time in seconds ( here 15 * 60 converts to 15 minutes ) | |
add_filter("cf_stripe_transients_status_duration", function() { | |
return 15 * 60; |
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 | |
/** | |
* caldera_forms_api_allow_pdf_download | |
* | |
* Control how it is allowed to download the PDF files | |
* | |
* @param boolean $allowed | |
* @param array $request | |
*/ | |
add_filter("caldera_forms_api_allow_pdf_download", function($allowed, $request ) { |