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 | |
/** | |
* Format Fields as Currency via jQuery | |
* http://gravitywiz.com/format-field-as-currency/ | |
*/ | |
class GWFormatMoney { | |
/** | |
* Stores a copy of the original field values so once the money-formatted numbers have been cleaned for validation | |
* they can be restored after being validated. |
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 | |
/** | |
* Simple Ticket Inventory with Gravity Forms / Limit by Sum of Field Values | |
* http://gravitywiz.com/2012/05/19/simple-ticket-inventory-with-gravity-forms/ | |
*/ | |
$sum_form_id = 86; | |
$sum_field_id = 14.3; | |
$sum_limit = 450; |
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
$sum_limit_message = '<div style="border: 1px solid #e6db55; background-color: #FFFFE0; padding: 10px;">Sorry, this show is sold out.</div>'; |
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 | |
/** | |
* Limit IP to One Submission Per Time Period | |
* http://gravitywiz.com/2012/05/12/limit-ip-to-one-submission-per-time-period | |
*/ | |
$gws_limit_message = 'You may only submit this form once every 24 hours.'; | |
$gws_limit_time = 86400; // must be specified in seconds; 86400 seconds is equal to 24 hours | |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-minimum-order-qty.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Minimum Order Quantity | |
* http://gravitywiz.com/set-a-minimum-order-quantity/ | |
*/ |
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 | |
/** | |
* WARNING! THIS SNIPPET MAY BE OUTDATED. | |
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library: | |
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-quantity-as-decimal.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Accept Decimal Values for Quantity Fields | |
* | |
* Allows you to accept decimal values in Quantity fields, converting any Quantity field into a weight field. |
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
/** | |
* Set Post Status by Field Value (Advanced) | |
* http://gravitywiz.com/2012/05/04/set-post-status-by-field-value-advanced/ | |
*/ | |
// update "3" to the ID of your form | |
add_filter('gform_post_data_3', 'gform_dynamic_post_status', 10, 3); | |
function gform_dynamic_post_status($post_data, $form, $entry) { | |
// update "5" to the ID of your custom post status field |
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
/** | |
* Set Post Status by Product Field Value | |
* http://gravitywiz.com/2012/05/04/set-post-status-by-field-value-advanced/ | |
*/ | |
// update "3" to the ID of your form | |
add_filter('gform_post_data_3', 'gform_dynamic_post_status', 10, 3); | |
function gform_dynamic_post_status($post_data, $form, $entry) { | |
// update "6" to the ID of your custom post status field |
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
switch($values[0]) { | |
case 'Basic Package': | |
$post_data['post_status'] = 'draft'; | |
break; | |
case 'Premium Package': | |
$post_data['post_status'] = 'publish'; | |
break; | |
} |