This file contains 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 is a filter to change the default validation message that Gravity Forms generates | |
add_filter('gform_validation_message', 'change_validation_message', 10, 2); | |
function change_validation_message($message, $form) | |
{ | |
return "<div class='validation_error'><strong>Oops!</strong> Looks like there’s something wrong. Please review the form above.</div>"; | |
} | |
// Often forms in Gravity Forms to need to start with default values and we need to check the form in case the user hasn't entered new data and give them a validation message back |
This file contains 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 | |
/** | |
* Send Gravity Forms file uploads to Amazon S3 | |
* @author Ren Ventura <EnageWP.com> | |
* @link http://www.engagewp.com/send-gravity-forms-file-uploads-to-amazon-s3/ | |
*/ | |
//* Include the required library | |
include_once 'inc/S3.php'; |
This file contains 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
/** | |
* Add the field to the checkout | |
**/ | |
add_action('woocommerce_after_order_notes', 'my_custom_checkout_field'); | |
function my_custom_checkout_field( $checkout ) { | |
echo '<div id="my_custom_checkout_field"><h3>'.__('My Field').'</h3>'; | |
/** |
This file contains 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
<script> | |
function ListFieldRowCount( listField, totalField ) { | |
var totalRows = jQuery( listField ).find('table.gfield_list tbody tr').length; | |
jQuery( totalField ).val( totalRows ).change(); | |
} | |
function ListFieldRowTotal( formId, fieldId, totalFieldId ) { | |
var listField = '#field_' + formId + '_' + fieldId; | |
var totalField = '#input_' + formId + '_' + totalFieldId; | |
ListFieldRowCount( listField, totalField ); | |
jQuery( listField ).on( 'click', '.add_list_item', function() { |