Created
October 28, 2015 11:46
-
-
Save spivurno/15592a66497096338864 to your computer and use it in GitHub Desktop.
Gravity Forms // Hooks // gform_userregistration_feed_settings_fields
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_filter( 'gform_userregistration_feed_settings_fields', 'add_custom_user_registration_setting', 10, 2 ); | |
function add_custom_user_registration_setting( $fields, $form ) { | |
// adding my custom setting to the Additional Settings section | |
$fields['additional_settings']['fields'][] = array( | |
'name' => 'myCustomSetting', | |
'label' => __( 'My Custom Setting', 'my-text-domain' ), | |
'type' => 'checkbox', | |
'choices' => array( | |
array( | |
'label' => __( 'This is the checkbox label', 'my-text-domain' ), | |
'value' => 1, | |
'name' => 'myCustomSetting' | |
) | |
), | |
'tooltip' => sprintf( '<h6>%s</h6> %s', __( 'Tooltip Header', 'my-text-domain' ), __( 'This is the tooltip description', 'my-text-domain' ) ), | |
// this setting should only be visible for "create" feeds (and not "update" feeds) | |
'dependency' => array( | |
'field' => 'feedType', | |
'values' => 'create' | |
) | |
); | |
return $fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment