Using Gravity Forms ‘gform_helpscout_enable_bcc’ PHP filter

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

Usage

add_filter('gform_helpscout_enable_bcc', '__return_true');

Parameters

This filter has no parameters.

More information

See Gravity Forms Docs: gform_helpscout_enable_bcc

Examples

Enable BCC field in Help Scout feed

This example enables the BCC field in the Help Scout feed settings.

add_filter('gform_helpscout_enable_bcc', '__return_true');

Conditionally enable BCC field based on form ID

This example enables the BCC field only for form with ID 1.

function enable_bcc_for_form_1($form_id) {
    if ($form_id == 1) {
        return true;
    }
    return false;
}
add_filter('gform_helpscout_enable_bcc', 'enable_bcc_for_form_1');

Enable BCC field for specific user roles

This example enables the BCC field only for users with the ‘administrator’ role.

function enable_bcc_for_administrators() {
    if (current_user_can('administrator')) {
        return true;
    }
    return false;
}
add_filter('gform_helpscout_enable_bcc', 'enable_bcc_for_administrators');

Enable BCC field for specific pages

This example enables the BCC field only when the form is displayed on the page with ID 42.

function enable_bcc_for_page_42() {
    global $post;
    if ($post->ID == 42) {
        return true;
    }
    return false;
}
add_filter('gform_helpscout_enable_bcc', 'enable_bcc_for_page_42');

Enable BCC field based on custom condition

This example enables the BCC field based on a custom condition (in this case, when the site is running on a localhost).

function enable_bcc_on_localhost() {
    if ($_SERVER['HTTP_HOST'] == 'localhost') {
        return true;
    }
    return false;
}
add_filter('gform_helpscout_enable_bcc', 'enable_bcc_on_localhost');