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 | |
//Copy everything below this line | |
/** | |
* | |
* Mark entry as spam if all checkbox choices are selected | |
* | |
* This is a unique use case, but if you have a checkbox that selecting all choices is unlikely you can use this as a spam prevention method. | |
* | |
* |
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
//Copy everything below this line | |
/** | |
* | |
* Conditionally Disable Radio Button Field | |
* | |
* This snippet disables a radio button field when a specific choice is selected in another radio button field. | |
* It will even clear the choice selection of the disabled field. | |
* See the link below for instructions. | |
* |
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
/** | |
* GravityRanger Limit Checkboxes | |
* | |
* This snippet allows you to limit the number of checkboxes that can be checked, and grays out and disables all other choices when that number is reached. | |
* | |
* | |
* @instructions: | |
* | |
* 1. Change 2 on line 24 to the number of checkbox choices you want the user to be able to select. | |
* 2. Change the 1_5 on line 27 to the formID_fieldID of your checkbox 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
<?php | |
//copy everything below this line | |
add_filter( 'gform_notification', 'change_notification_email', 10, 3 ); | |
function change_notification_email( $notification, $form, $entry ) { | |
if ( $notification['name'] == 'Admin Notification' ) { | |
// toType can be routing or email |
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 | |
// Copy everything below this line | |
/** | |
* GravityRanger Dual Confirmation (text + redirect) | |
* https://gravityranger.com/display-text-confirmation-before-redirecting-gravity-forms | |
* | |
* Uses the gform_confirmation hook to display a text confirmation message before triggering the redirect confirmation. | |
* This code is a modified version of the snippet provided on docs.gravityfroms.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
'AF' => __( 'Afghanistan', 'gravityforms' ), | |
'AX' => __( 'Åland Islands', 'gravityforms' ), | |
'AL' => __( 'Albania', 'gravityforms' ), | |
'DZ' => __( 'Algeria', 'gravityforms' ), | |
'AS' => __( 'American Samoa', 'gravityforms' ), | |
'AD' => __( 'Andorra', 'gravityforms' ), | |
'AO' => __( 'Angola', 'gravityforms' ), | |
'AI' => __( 'Anguilla', 'gravityforms' ), | |
'AQ' => __( 'Antarctica', 'gravityforms' ), | |
'AG' => __( 'Antigua and Barbuda', 'gravityforms' ), |
NewerOlder