Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save spivurno/15592a66497096338864 to your computer and use it in GitHub Desktop.
Save spivurno/15592a66497096338864 to your computer and use it in GitHub Desktop.
Gravity Forms // Hooks // gform_userregistration_feed_settings_fields
<?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