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 | |
add_action( 'gravityflow_post_webhook', 'sh_action_gravityflow_post_webhook', 10, 4 ); | |
function sh_action_gravityflow_post_webhook( $response, $args, $entry, $current_step ) { | |
//Replace step ID and fields for calculation to match your use case. | |
if ( $current_step->get_id() == 77 && is_numeric( $entry['3'] ) && is_numeric( $entry['16'] ) ) { | |
$entry['14'] = round( $entry['3'] * $entry['16'], 2); | |
$result = GFAPI::update_entry( $entry ); | |
} | |
} |
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
// this will set default order by invoice/quote number | |
if ( is_admin() ) { | |
add_action( 'pre_get_posts', 'sliced_set_default_orderby', 11 ); | |
} | |
function sliced_set_default_orderby( $query ) { | |
// double check to avoid interfering with any ajax requests | |
if ( ! sliced_get_the_type() ) { |
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 | |
/** | |
* Gravity Perks // GP Limit Dates // Block Date Range via Exceptions | |
*/ | |
add_filter( 'gpld_limit_dates_options_1364_1', 'gpld_except_date_range', 10, 3 ); | |
function gpld_except_date_range( $options, $form, $field ) { | |
$start_date = '2016-07-15'; | |
$end_date = '2017-01-01'; |
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_filter( 'gform_pre_replace_merge_tags', function ( $text, $form, $entry ) { | |
if ( strpos( $text, '{workflow_cancel_link}' ) === false || empty( $entry ) || ! class_exists( 'Gravity_Flow_Merge_Tags' ) ) { | |
return $text; | |
} | |
$api = new Gravity_Flow_API( $form['id'] ); | |
$step = $api->get_current_step( $entry ); | |
if ( ! $step ) { | |
return $text; |
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 | |
/** | |
* Gravity Wiz // Gravity Forms // Chained Selects for List Fields | |
* | |
* Convert List Field inputs into selects and allow them to be chained. | |
* | |
* @version 1.13 | |
* @author David Smith <[email protected]> | |
* @license GPL-2.0+ | |
* @link http://gravitywiz.com/... |
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
{ | |
"USD": { | |
"name": "U.S. Dollar", | |
"symbol_left": "$", | |
"symbol_right": "", | |
"symbol_padding": "", | |
"thousand_separator": ",", | |
"decimal_separator": ".", | |
"decimals": 2 | |
}, |
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-populate-date.php | |
*/ | |
/** | |
* Gravity Wiz // Gravity Forms // Populate Date (Usage) | |
*/ |
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
DELETE FROM wp_usermeta | |
WHERE NOT EXISTS ( | |
SELECT * FROM wp_users | |
WHERE wp_usermeta.user_id = wp_users.ID | |
) |
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 | |
/** | |
* WP Redix Index | |
* | |
* Redis caching system for WordPress. Inspired by Jim Westergren. | |
* | |
* @author Jeedo Aquino | |
* @see http://www.jeedo.net/lightning-fast-wordpress-with-nginx-redis/ | |
* @see http://www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/ | |
*/ |
NewerOlder