Using Gravity Forms ‘gform_entry_meta_conditional_logic_notifications’ PHP action

The gform_entry_meta_conditional_logic_notifications filter allows you to modify the entry meta conditional logic filters on the Gravity Forms notification edit page.

Usage

add_filter('gform_entry_meta_conditional_logic_notifications', 'conditional_logic_filters', 10, 3);

Parameters

  • $filters (array) – The array of filters.
  • $form (Form Object) – The form object.
  • $id (int) – The ID of the form.

More information

See Gravity Forms Docs: gform_entry_meta_conditional_logic_notifications

Examples

Remove specific entry meta filters based on form settings

This example removes certain entry meta filters depending on the form settings.

add_filter('gform_entry_meta_conditional_logic_notifications', 'conditional_logic_filters', 10, 3);

function conditional_logic_filters($filters, $form, $id) {
    $quiz_fields = GFAPI::get_fields_by_type($form, array('quiz'));

    if (empty($quiz_fields))
        return $filters;

    switch (self::get_form_setting($form, 'grading')) {
        case "letter":
            if (false === isset($form['gquizDisplayConfirmationLetter']) || $form['gquizDisplayConfirmationLetter'])
                unset($filters['gquiz_is_pass']);
            break;
        case "passfail":
            if (false === isset($form['gquizDisplayConfirmationPassFail']) || $form['gquizDisplayConfirmationPassFail'])
                unset($filters['gquiz_grade']);
            break;
        default:
            unset($filters['gquiz_grade']);
            unset($filters['gquiz_is_pass']);
    }

    return $filters;
}

Placement: This code should be placed in the functions.php file of your active theme.

Source Code: This action hook is located in GFNotification::notification_edit_page() in notification.php.