Skip to content

Upgrade Guide: Fluent Forms 6.2.0 ​

Fluent Forms Core Breaking Changes

Fluent Forms 6.2.0 upgrades the internal WPFluent Framework to v2. If you maintain a plugin or custom code that integrates with Fluent Forms, review the changes below.

get() Returns Collection Instead of Array ​

Starting from 6.2.0, the get() method returns a Collection object instead of a plain PHP array:

php
// Both of these now return a Collection, not an array
$forms = FluentForm\App\Models\Form::where('status', 'published')->get();
$forms = wpFluent()->table('fluentform_forms')->get();

The items inside are unchanged — you still access properties with $item->name (arrow syntax). Only the outer wrapper changed.

Quick Fix ​

Add ->all() after ->get() to get a plain array back:

php
$forms = FluentForm\App\Models\Form::where('status', 'published')->get()->all();

->all() vs ->toArray()

Use ->all() — it returns an array but keeps each item as an object ($item->name). ->toArray() converts each item into an associative array too ($item['name']), which will break your existing property access.

What Still Works ​

These common patterns work the same as before — no changes needed:

php
$forms = FluentForm\App\Models\Form::where('status', 'published')->get();

// Looping
foreach ($forms as $form) {
    echo $form->title;
}

// Counting
if (count($forms) > 0) {
    // ...
}

// Index access
$first = $forms[0];

// isset check
if (isset($forms[0])) {
    // ...
}

// JSON encoding
echo json_encode($forms);

What Breaks ​

PHP Array Functions — Fatal Error ​

Any native array_* function will crash because Collection is not an array:

php
$forms = FluentForm\App\Models\Form::get();

// ALL of these will FATAL:
array_map(fn($f) => $f->id, $forms);
array_filter($forms, fn($f) => $f->status === 'active');
array_merge($forms, $otherArray);
array_column($forms, 'id');
array_keys($forms);
array_values($forms);
array_slice($forms, 0, 5);
in_array($item, $forms);

Fix — convert to array first:

php
$forms = FluentForm\App\Models\Form::get()->all();
array_map(fn($f) => $f->id, $forms); // works

Or use Collection methods:

php
$forms = FluentForm\App\Models\Form::get();
$ids    = $forms->map(fn($f) => $f->id)->all();             // replaces array_map
$active = $forms->filter(fn($f) => $f->status === 'active'); // replaces array_filter
$first  = $forms->first();                                    // replaces reset()
$last   = $forms->last();                                     // replaces end()
$sliced = $forms->take(5);                                    // replaces array_slice
$exists = $forms->contains($item);                            // replaces in_array

See the Collections page for all available methods.

Empty Checks — Silent Bug ​

A Collection is always "truthy" in PHP, even with zero items:

php
$forms = FluentForm\App\Models\Form::where('id', -1)->get(); // empty result

// BROKEN — these conditions no longer work as expected:
if (!$forms) { }           // always false
if (empty($forms)) { }    // always false
if ($forms) { }            // always true

Fix — use count():

php
if (!count($forms)) {
    return; // empty check
}

if (count($forms)) {
    // not-empty check
}

Type Checks and Type Hints ​

php
// BROKEN
if (is_array($forms)) { }           // returns false now
function processItems(array $items) {} // TypeError

// Fix
if (is_array($forms) || $forms instanceof \Traversable) { }
processItems($forms->all());

Renamed Namespaces ​

The following namespaces have changed. Backward-compatible aliases exist so old imports still work, but will be removed in 7.0.

Database Migrations ​

Old (deprecated)New
FluentForm\App\Databases\Migrations\FormSubmissionsFluentForm\Database\Migrations\Submissions
FluentForm\App\Databases\Migrations\SubmissionDetailsFluentForm\Database\Migrations\SubmissionDetails

Framework Request Classes ​

Old (deprecated)New
FluentForm\Framework\Request\RequestFluentForm\Framework\Http\Request\Request
FluentForm\Framework\Request\FileFluentForm\Framework\Http\Request\File

ArrayHelper ​

Old (deprecated)New
FluentForm\Framework\Helpers\ArrayHelperFluentForm\Framework\Support\Arr

Deprecated Classes ​

The following classes have been replaced with minimal stubs. They still work but log deprecation warnings in debug.log when WP_DEBUG is enabled. Will be removed in 7.0.

ClassReplacement
FluentForm\App\Modules\Entries\EntriesFluentForm\App\Models\Submission model or wpFluent() queries
FluentForm\App\Modules\Entries\EntryQueryFluentForm\App\Models\Submission model or wpFluent() queries
FluentForm\App\Modules\Entries\ReportFluentForm\App\Services\Report\ReportHelper

Example migration:

php
// Before (deprecated)
$entries = wpFluentForm('FluentForm\App\Modules\Entries\Entries')->_getEntries(
    $formId, $page, $perPage, $orderBy, $status, null, $wheres
);

// After
use FluentForm\App\Models\Submission;

$query = (new Submission)->customQuery([
    'form_id'    => $formId,
    'sort_by'    => $orderBy,
    'entry_type' => $status,
    'search'     => $search,
]);
$submissions = $query->get();

Hook Names (Since 5.0) ​

Removed in 7.0

All hooks were renamed from underscore/hyphen format to slash format in Fluent Forms 5.0. Old names still fire via do_action_deprecated() but will be removed in 7.0.

php
// Before (deprecated — will be removed in 7.0)
add_action('fluentform_loaded', function ($app) { });
add_filter('fluentform_editor_shortcodes', function ($shortcodes) { });

// After
add_action('fluentform/loaded', function ($app) { });
add_filter('fluentform/editor_shortcodes', function ($shortcodes) { });

The pattern is consistent: replace fluentform_ or fluentform- with fluentform/.

Enable WP_DEBUG to see which hooks in your code need updating.

Summary ​

ChangeSeverityBackward CompatRemove in
get() returns CollectionFatal for array_* functionsNo — add ->all()N/A
Database migration namespacesAlias existsYes7.0
Request class namespacesAlias existsYes7.0
ArrayHelper namespaceAlias existsYes7.0
Entries/EntryQuery classesStub existsYes7.0
Hook names (_ → /)do_action_deprecatedYes7.0

Last updated:

Fluent Forms developer documentation