fluentform_entry_statuses

Description #

By default Fluent Forms has the following statuses for form entries

  • Unread
  • Read
  • Trashed
        $statuses = apply_filters('fluentform_entry_statuses', [
            'unread' => 'Unread',
            'read'   => 'Read'
        ], $form_id);

If you need to add custom status then you can use this filter hook.

Usage #

The following code will add a new status for all your forms.

        add_filter('fluentform_entry_statuses', function ($statuses) {
            $statuses['important'] = 'Important';
            return $statuses;
        }, 10, 1);

If you want to add a specific status to a specific form (say form id 3) only then you can use the following code:

        add_filter('fluentform_entry_statuses', function ($statuses, $formId) {
            if($formId == 3) {
                $statuses['important'] = 'Important';
            }
            return $statuses;
        }, 10, 2);

Parameters #

  • $statuses (array) key-value paired array of the statuses
  • $formId integer Form id

Placement #

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

Source Code #

This filter is located at fluentform/app/Helpers/Helper.php#getEntryStatuses()

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *