Using Gravity Forms ‘gform_helpscout_enable_cc’ PHP filter

The gform_helpscout_enable_cc is a Gravity Forms PHP filter that enables the display of the CC setting on the Help Scout feed.

Usage

To use the filter, add the following code to your theme’s functions.php file:

add_filter('gform_helpscout_enable_cc', '__return_true');
// your custom code here

Parameters

This filter has no parameters.

More information

See Gravity Forms Docs: gform_helpscout_enable_cc

Please make sure to place this code in the functions.php file of your active theme. The filter is located in class-gf-helpscout.php.

Examples

Enable CC Setting

Enable the CC setting on the Help Scout feed by default.

add_filter('gform_helpscout_enable_cc', '__return_true');
// CC setting will be enabled

Enable CC Setting Conditionally

Enable the CC setting on the Help Scout feed based on a custom condition.

function my_custom_enable_cc($enabled) {
    // Check your custom condition
    if (/* your custom condition */) {
        return true;
    }
    return $enabled;
}
add_filter('gform_helpscout_enable_cc', 'my_custom_enable_cc');
// CC setting will be enabled if custom condition is met

Disable CC Setting

Disable the CC setting on the Help Scout feed by default.

add_filter('gform_helpscout_enable_cc', '__return_false');
// CC setting will be disabled

Toggle CC Setting Based on User Role

Enable the CC setting on the Help Scout feed for a specific user role.

function enable_cc_for_role($enabled) {
    // Check user role
    $user = wp_get_current_user();
    if (in_array('your_specific_role', $user->roles)) {
        return true;
    }
    return $enabled;
}
add_filter('gform_helpscout_enable_cc', 'enable_cc_for_role');
// CC setting will be enabled if user has the specific role

Toggle CC Setting Based on Form ID

Enable the CC setting on the Help Scout feed for a specific form.

function enable_cc_for_form($enabled, $form) {
    // Check form ID
    if ($form['id'] == 'your_specific_form_id') {
        return true;
    }
    return $enabled;
}
add_filter('gform_helpscout_enable_cc', 'enable_cc_for_form', 10, 2);
// CC setting will be enabled if form has the specific form ID