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: Direct Stripe Filter Emails | |
* Description: Filter Emails sent by Direct Stripe | |
* Author: New0 | |
* Author URI: https://newo.me/ | |
* Version: 0.0.1 | |
*/ | |
add_filter( 'direct_stripe_success_user_email_content', function( $message, $amount, $currency, $email_address, $description, $user, $button_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 | |
/** | |
* Allow all requests to read entries of form with ID CF123567 | |
* | |
* For API endpoint that powers front-end entry viewer. | |
*/ | |
add_filter( 'caldera_forms_api_allow_entry_view', function( $allowed, $form_id, WP_REST_Request $request ){ | |
if( 'CF123567' === $form_id ){ | |
return true; | |
} |
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 | |
//Unset success message and set a different error message for admin users and others | |
add_filter('caldera_forms_render_notices', function ($notices) { | |
//Unset success message | |
unset($notices['success']['note']); | |
//Set error message for admins | |
if ( current_user_can('administrator') ) { |
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: CF Force process state | |
* Description: Force process state, start spinner and deactivate fields. | |
*/ | |
add_filter('wp_footer', function(){ | |
echo '<script type="text/javascript"> | |
jQuery(".caldera-grid input[type=\'submit\']").on("click", function() { | |
var form = jQuery(this).parent("form"); |
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: CF paragraph settings | |
* | |
*/ | |
add_filter( 'caldera_forms_field_attributes', function( $attrs, $field, $form ){ | |
//Set the field IDs here | |
$fields = [ 'fld_456', 'fld_457', 'fld_458' ]; | |
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, $form ){ | |
if( 'button' === Caldera_Forms_Field_Util::get_type( $field, $form ) ){ | |
$attrs[ 'data-form-id' ] = $form[ 'ID' ]; | |
} | |
return $attrs; | |
}, 20, 3 ); |
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 | |
/** | |
* Change Caldera Forms Stripe Payment Amount | |
*/ | |
add_filter( 'cf_stripe_charge_args', function( $args, $config, $form ){ | |
//change charge amounts to $10. Amount is in cents. | |
$args[ 'amount' ] = 1000; | |
return $args; | |
}, 10, 4 ); |
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: CF entries as user meta data | |
* Description: Save entries as USER metadata, display list of entries for a user to see / edit them | |
* Author: New0 | |
*/ | |
/** | |
* On form submit, associate new entries to USER | |
*/ |
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: DS Cross Border Classification | |
* Author: Nicolas Figueira | |
* Author URI: https://newo.me | |
* Description: Declare Cross Border Classification during Direct Stripe transactions | |
* Plugin URI: https://gist.github.com/New0/69100a1d6ba749c0e15d03cef9a4481b/edit | |
* Version: 1.0.0 | |
*/ | |
function ds_cbc($data, $user, $token, $button_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 | |
/* Custom Direct Stripe spinner animation */ | |
add_filter( 'direct_stripe_processing_transaction_spinner', function( $html, $begin, $end, $text, $dots, $instance){ | |
return '<div id="loadingDS-' . $instance . '" class="loadingDS-container loader" style="display:none;"></div>'; | |
}, 10, 6); |