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 // eCommerce Fields // Tax Amount by Field Value | |
| * https://gravitywiz.com/documentation/gravity-forms-ecommerce-fields/ | |
| * | |
| * Set the amount of a Tax field based on: | |
| * | |
| * 1. A static mapping tied to another field's value. | |
| * 2. The current value of another field. | |
| * |
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 | |
| class GPECF_Tax_Amounts_By_Field_Value { | |
| private $_args = array(); | |
| public function __construct( $args = array() ) { | |
| // set our default arguments, parse against the provided arguments, and store for use throughout the class | |
| $this->_args = wp_parse_args( $args, array( | |
| 'form_id' => false, |
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
| /** | |
| * GP Advanced Select — allow duplicate-valued choices (STANDALONE, no plugin changes). | |
| * | |
| * Tom Select (which powers Advanced Select) keys its options by value and silently collapses any | |
| * options that share one. So on a single-select Advanced Select dropdown — e.g. one populated by | |
| * Populate Anything with "unique results" OFF — two choices that share a value but have different | |
| * labels (value `5` shown as both "Math" and "Mathematics") get merged into one option. | |
| * | |
| * This snippet preserves them by giving each colliding choice a unique SYNTHETIC id (so Tom Select | |
| * keeps them all) and mirrors the selected option's REAL value into a companion hidden input that |
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 | |
| // TODO : Update Constants. | |
| define( 'GPB_GCAL_SYNC_ACCOUNT', 'whatever@gmail.com' ); | |
| define( 'GPB_GCAL_SYNC_CALENDAR', 'calendar_ID@group.calendar.google.com' ); | |
| add_action( 'gpb_availability_block_added', function ( int $block_id, array $block_data, $bookable ) { | |
| // Sync Negative/Unavailability blocks. | |
| if ( empty( $block_data['is_negative'] ) ) { | |
| return; |
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_action( 'gform_post_entry_list', function( $form_id ) { | |
| if ( ! is_admin() ) { | |
| return; | |
| } | |
| $user_id = get_current_user_id(); | |
| $tokens = gp_advanced_save_and_continue()->get_current_user_resume_tokens( $form_id, '*' ); // '*' for all users if admin | |
| if ( empty( $tokens ) ) { |
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 | |
| define( 'EMAILIT_API_KEY', 'REPLACE_WITH_YOUR_API_KEY' ); | |
| add_filter( 'gpev_validation_result', function ( $result, $value, $email ) { | |
| if ( empty( EMAILIT_API_KEY ) ) { | |
| return $result; | |
| } |
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 | |
| define( 'EMAILIT_API_KEY', 'REPLACE_WITH_YOUR_API_KEY' ); | |
| add_filter( 'gpev_validation_result', function ( $result, $value, $email ) { | |
| if ( empty( EMAILIT_API_KEY ) ) { | |
| return $result; | |
| } |
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 | |
| define( 'EMAILIT_API_KEY', 'REPLACE_WITH_API_KEY' ); // TODO: Replace with your actual API key | |
| add_filter( 'gpev_validation_result', function ( $result, $value, $email ) { | |
| if ( ! defined( 'EMAILIT_API_KEY' ) || empty( EMAILIT_API_KEY ) ) { | |
| return $result; | |
| } | |
| $response = wp_remote_post( | |
| 'https://api.emailit.com/v2/email-verifications', |
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
| let targetFieldId = 4; // TODO: Update field id | |
| let initTimeout; | |
| function selectAllMultiSelect() { | |
| let $target = $('#input_GFFORMID_' + targetFieldId); | |
| // Prevent duplicate init | |
| if (!$target.length || $target.data('select-all-init')) { | |
| return; | |
| } |
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 | |
| // EmailIt Configuration - EDIT THESE VALUES | |
| define( 'EMAILIT_API_KEY', 'REPLACE_API_KEY' ); // Replace with your actual API key | |
| define( 'EMAILIT_ENABLED', true ); // Set to true to enable EmailIt validation | |
| add_filter( 'gpev_validation_result', function ( $result, $value, $email ) { | |
| if ( ! defined( 'EMAILIT_ENABLED' ) || ! EMAILIT_ENABLED ) { | |
| return $result; |
NewerOlder