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 custom code | |
* Description: Create subscriptions based on donation amount | |
* Author: Nicolas Figueira | |
* Version: 0.0.1 | |
* | |
* To use this as a plugin : | |
* – Edit the code with the css ID you set for your button | |
* – Zip the file |
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: Disable Direct Stripe Gutenberg Block | |
* Description: Disable Direct Stripe Gutenberg Block | |
* Version: 1.0.0 | |
* Author: Nicolas Figueira | |
* Author URI: https://newo.me | |
* | |
* This can be loaded as a plugin -> Download ZIP and from the WordPress adin go to Plugins -> Add Plugin and Click the Upload Plugin button to upload this zip and activate the plugin | |
* |
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 | |
//Example of how to use a Disabled attribute for options in Checkbox, dropdown or select 2 fields | |
add_filter( 'caldera_forms_render_get_field', function( $field ) { | |
if( 'fld_4425558' === $field[ 'ID' ] ){ //Field ID => 'fld_4425558' | |
$field[ 'config' ][ 'option' ]['opt1996332']['disabled'] = true; // Option ID => 'opt1996332' | |
} else if( 'fld_7668742' === $field[ 'ID' ] ){ //Field ID => 'fld_7668742' | |
$field[ 'config' ][ 'option' ]['opt3137985']['disabled'] = true; // Option ID => 'opt3137985' | |
} else if( 'fld_381620' === $field[ 'ID' ] ){ //Field ID => 'fld_381620' | |
$field[ 'config' ][ 'option' ]['opt1172954']['disabled'] = true; // Option ID => 'opt1172954' | |
} |
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 input coupons | |
* Author: Nicolas Figueira | |
* Description: Allow users to use promotional coupons with Direct Stripe | |
* Version: 0.0.1 | |
* Text Domain: ds-coupons | |
* | |
* This is not production ready | |
* It will add an input field for coupon with CSS ID button_with_coupon |
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 currency code | |
* Description: Add currency code after Direct Stripe donation input field | |
* Version: 0.0.1 | |
* Author: Nicolas Figueira | |
* Author URI: https://newo.me | |
*/ | |
add_filter( 'direct_stripe_donation_input', function( $direct_stripe_donation_input, $instance, $button_id ) { | |
if( $button_id === 'euros-button' ){ // Edit with the CSS ID of button in euros |
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 metadata parameter to the Direct Stripe button | |
*/ | |
add_action( 'direct_stripe_charge_data', function($data, $user, $token, $button_id) { | |
$data[] = array( | |
"metadata" => array( | |
"key" => "value" | |
) |
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); |
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 | |
/* | |
* 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 | |
/** | |
* 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 ); |