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 Stripe Payment description | |
* Author: Nicolas Figueira | |
* Descriptipon: Display the description in the payments on the Stripe dashboard | |
* | |
*/ | |
add_filter( 'cf_stripe_charge_args', function( $args, $config, $form ){ | |
//The description can also be set to be different from the processor's settings |
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 | |
/* | |
* Validates fields only using a Social security number pattern like 999-99-999 | |
* EDIT FIELDS IDS TO BE VALIDATED "fld_5675945", "fld_1648505" | |
*/ | |
add_filter( 'caldera_forms_field_attributes', function( $attrs, $field, $form ){ | |
$fields = ["fld_5675945", "fld_1648505"]; | |
if( in_array( $field['ID'], $fields ) ){ | |
$attrs[ 'pattern' ] = '^\d{3}-\d{2}-\d{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 | |
/* | |
* This will allow a user with ID 2 to view the entry viewer even without the manage_optiuons capability | |
* REPLACE 2 by the correct user ID | |
*/ | |
add_filter('caldera_forms_manage_cap', function( $cap, $context, $form ){ | |
if( is_user_logged_in() ){ | |
$user_id = get_current_user_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 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'); |
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 | |
//this applies change when creating plans | |
add_filter( 'cf_stripe_recurring_args', 'my_cf_stripe_recurring_filter', 10, 2 ); | |
//this applies change when creating one time payments | |
add_filter( 'cf_stripe_charge_args', 'my_cf_stripe_single_filter', 10, 2 ); | |
//this is the callback to change arguments sent to API | |
//Be careful not to set a field that isn't supported or the API will reject the charge. | |
//Description for single payments |
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["line_items"][0][ "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 | |
/** | |
* Allow different field values of same field to have different limits when using Caldera Forms Entry Limitter | |
* | |
* Requires version 1.2.0 or later | |
*/ | |
add_filter( 'cf_entry_limiter_entry_limit', function( $limit, $entry, $field, $form ){ | |
//IMPORTANT: Change fld_9970286 to your field's ID | |
if( 'fld_9970286' === $field[ 'ID' ] ){ | |
//IMPORTANT: Use the field values (not labels) in these conditionals |
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 tabindex on radio options | |
* Autor: New0 | |
* Description: Add tabindex on options of radio fields in CF | |
*/ | |
//Example of adding a tabindex to radio fields options in Caldera Forms | |
// If there are multiple radio fields on same page, target each field using the field ID between caldera-grid and radio classes. | |
//Like ".caldera-grid #fld_8471527_1-wrap .radio label input" replacing #fld_8471527 by the field ID ( and keeping _1-wrap attached). |
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 custom code | |
* Author: New0 | |
* Description: Force connected Submit button text if translation didn't apply | |
*/ | |
add_action('wp_footer', function() { | |
?> | |
<script type="text/javascript"> |
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 allow all viewers | |
* Author: New0 | |
* Description: Allow all requests to read entries of form with ID CF5c78740daac4a | |
*/ | |
/** | |
* For API endpoint that powers front-end entry viewer. | |
*/ |