Skip to content

Instantly share code, notes, and snippets.

Nicolas Figueira New0

Block or report user

Report or block New0

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@New0
New0 / exemple.js
Created Nov 21, 2019
Correction $ is not defined
View exemple.js
/**ADMIN BO Intervenants+Entreprtises partenaires add (supprimer/publier/masquer)
* @param string type = publish
* @param int id = 8
*/
jQuery(document).ready(function($) {
/**
* SPEaKERS
* UPDATE
@New0
New0 / cf-tabindex-radio-options.php
Last active Nov 19, 2019
//Example of adding a tabindex to radio fields options in Caldera Forms
View cf-tabindex-radio-options.php
<?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).
@New0
New0 / cf-custom-code.php
Created Nov 8, 2019
Replace text in CF Connected Forms buttons
View cf-custom-code.php
<?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">
@New0
New0 / cf-allow-all-viewers.php
Last active Nov 1, 2019
Allow all users (non logged-in) to view the Caldera Forms entry for a prcise form.
View cf-allow-all-viewers.php
<?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.
*/
@New0
New0 / DS-filter-emails.php
Last active Oct 27, 2019
To be installed as a plugin - Filter Emails sent by Direct Stripe
View DS-filter-emails.php
<?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 ){
@New0
New0 / caldera_forms_api_allow_entry_view-1.php
Last active Oct 18, 2019 — forked from Shelob9/caldera_forms_api_allow_entry_view-1.php
Code examples for caldera_forms_api_allow_entry_view filter to change who can see Caldera Forms front-end entry viewer and corresponding REST API endpoint
View caldera_forms_api_allow_entry_view-1.php
<?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;
}
@New0
New0 / cf-set-custom-error-notices.php
Created Oct 14, 2019
Set custom error messages during custom Caldera Forms process
View cf-set-custom-error-notices.php
<?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') ) {
@New0
New0 / cf-force-process-state.php
Last active Oct 10, 2019
Force process state, start spinner and deactivate fields on submit button click for Caldera Forms.
View cf-force-process-state.php
<?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");
@New0
New0 / cf-paragraph-settings.php
Last active Sep 20, 2019
Plugin to set the maxlength to multiple Caldera Forms paragraphs fields
View cf-paragraph-settings.php
<?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' ];
@New0
New0 / caldera_forms_field_attributes-add-attr.php
Last active Sep 19, 2019 — forked from Shelob9/caldera_forms_field_attributes-add-attr.php
Examples of how to use the Caldera Forms filter caldera_forms_field_attributes to modify Caldera Forms input elements. See: https://calderaforms.com/doc/caldera_forms_field_attributes/
View caldera_forms_field_attributes-add-attr.php
<?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 );
You can’t perform that action at this time.