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 | |
/** | |
* Gravity Wiz // Gravity Forms // Default Form List to Active Forms | |
* http://gravitywiz.com/ | |
*/ | |
add_action( 'plugins_loaded', function() { | |
if( is_callable( array( 'GFForms', 'get_page' ) ) && GFForms::get_page() == 'form_list' ) { | |
if ( ! isset( $_GET['filter'] ) ) { | |
wp_redirect( add_query_arg( array( 'filter' => 'active' ) ) ); | |
exit; |
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 | |
/** | |
* Gravity Perks // Populate Anything // Add Line Break Between Live Merge Tag Checkbox Values | |
* https://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
*/ | |
// Update "123" with your form ID and "4" with your Checkbox field ID. | |
add_filter( 'gppa_live_merge_tag_value_123_4', function( $value, $merge_tag, $form, $field_id, $entry_values ) { | |
$values = array_map( 'trim', explode( ',', $value ) ); | |
return implode( '<br>', $values ); | |
}, 10, 5 ); |
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 | |
/** | |
* Gravity Wiz // Gravity Forms // Round Robin | |
* | |
* Cycle through the choices of a designated field assigning the next available choice when an entry is submitted. The | |
* cycle starts with the first choice progressing to the next available choice on each submission. After each choice has | |
* been assigned it will restart from the first choice. | |
* | |
* This functionality is useful when distributing leads evenly to a group of sales reps, scheduling shifts such that | |
* employees are assigned to the next available shift, and/or balancing the responsibility of any task-oriented |
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
/** | |
* Gravity Perks // Pay Per Word // Split Words on Specific Characters (JS) | |
* https://gravitywiz.com/documentation/gravity-forms-pay-per-word/ | |
*/ | |
gform.addFilter( 'gpppw_word_count', function( wordCount, text, gwppw, ppwField, formId ) { | |
// Splits words on periods, underscores, and asterisks. | |
var words = text.replace( /[\.\_\*]/g, ' ' ).match( /\S+/g ); | |
return words == null ? 0 : words.length; | |
} ); |
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_filter( 'gpecf_order_sumary_markup', 'get_custom_order_summary_markup', 10, 6 ); | |
function get_custom_order_summary_markup( $markup, $order, $form, $entry, $order_summary, $labels ) { | |
ob_start(); | |
?> | |
<table class="gpecf-order-summary" cellspacing="0" width="100%" style="<?php gp_ecommerce_fields()->style( '.order-summary' ); ?>"> | |
<thead> | |
<tr> | |
<th scope="col" style="<?php gp_ecommerce_fields()->style( '.order-summary/thead/th.column-1' ); ?>"><?php echo $labels['product']; ?></th> |
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 | |
/** | |
* Gravity Perks // Populate Anything // Populate Multi-file Upload Images as Separate Choices | |
* http://gravitywiz.com/documentation/gravity-forms-populate-anything/ | |
*/ | |
// Update "123" to your form ID; update "4" to the ID the field you're populating via Populate Anything. | |
add_filter( 'gppa_input_choices_123_4', function( $choices, $field, $objects ) { | |
$parsed_choices = array(); | |
foreach( $choices as $choice ) { | |
$_choices = explode( ', ', $choice['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
@media only screen and (max-width: 480px) { | |
.ui-datepicker.ui-datepicker-inline { | |
width: 100%; | |
} | |
.ui-datepicker.ui-datepicker-inline td span, .ui-datepicker.ui-datepicker-inline td a { | |
width: auto; | |
display: block; | |
} |
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 | |
/** | |
* Gravity Perks // Easy Passthrough // Save EP Token to Field | |
* http://gravitywiz.com/documentation/gravity-forms-easy-passthrough/ | |
* | |
* This snippet allows you to populate the EP token into a field so it can be mapped in Gravity Forms feeds. The filter | |
* fires before feeds are processed so the token is available in time. | |
*/ | |
// Update "123" to your form ID. | |
add_filter( 'gform_entry_post_save_123', function( $entry, $form ) { |
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 | |
/** | |
* Gravity Wiz // Gravity Forms // Check If Form Will Be Loaded on Page | |
* http://gravitywiz.com/ | |
* | |
* This snippet will allow you to check if a form will be loaded on the current page and do something if it will be. | |
* Note: this is a simple version that will only work on singular views where the [gravityforms] shortcode is used in | |
* the post content. | |
* | |
* @todo: |