Skip to content

Spaces Filters

18 unique filter hooks currently map to this category, across 21 call sites.

Hook Inventory

HookEditionCall SitesFirst Source
fluent_community/all_spaces_api_responseCore1fluent-community/app/Http/Controllers/SpaceController.php:245
fluent_community/get_lockscreen_settingsCore1fluent-community/app/Http/Controllers/SpaceController.php:996
fluent_community/lockscreen_fieldsCore1fluent-community/app/Services/LockscreenService.php:80
fluent_community/lockscreen_formatted_fieldCore1fluent-community/app/Services/LockscreenService.php:112
fluent_community/main_menu_itemsCore2fluent-community/app/Functions/Utility.php:1242
fluent_community/menu_groupsCore1fluent-community/app/Services/Helper.php:1341
fluent_community/menu_items_api_responseCore1fluent-community/app/Http/Controllers/OptionController.php:31
fluent_community/menu_settings_api_responseCore1fluent-community/app/Http/Controllers/SettingController.php:109
fluent_community/mobile_menuCore1fluent-community/app/Services/Helper.php:1636
fluent_community/settings_menuCore1fluent-community/app/Functions/Utility.php:1237
fluent_community/space_api_responseCore1fluent-community/app/Http/Controllers/SpaceController.php:273
fluent_community/space_groups_api_responseCore1fluent-community/app/Http/Controllers/SpaceController.php:844
fluent_community/space/create_dataCore1fluent-community/app/Http/Controllers/SpaceController.php:79
fluent_community/space/join_status_for_privateCore1fluent-community/app/Http/Controllers/SpaceController.php:498
fluent_community/space/meta_fieldsCore1fluent-community/app/Http/Controllers/SpaceController.php:1006
fluent_community/space/update_dataCore1fluent-community/app/Http/Controllers/SpaceController.php:345
fluent_community/spaces_api_responseCore2fluent-community/app/Http/Controllers/SpaceController.php:34
fluent_community/update_lockscreen_settingsPRO2fluent-community-pro/app/Http/Controllers/ProAdminController.php:422

fluent_community/all_spaces_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the paginated all-spaces directory response.

A different endpoint from fluent_community/spaces_api_response: this one lists spaces the viewer could join, not just their own. Non-moderators see only public and private spaces plus any secret space they already belong to. Member counts are zeroed for spaces that hide them from non-members, and each space has been through formatSpaceData() and fluent_community/space.

Parameters

#NameTypeDescription
1$dataarrayResponse payload with a paginated spaces block.
2$requestDataarrayThe full request parameters.

Return: The response payload array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:245[ 'spaces' => $spaces ] (array)
$request->all() (array)

Example

php
add_filter('fluent_community/all_spaces_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/spaces_api_response · fluent_community/space

fluent_community/get_lockscreen_settings

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the lock-screen configuration served for one space.

This is the settings-editing view, reached through the space lock-screen endpoint; the reader-facing lock screen is assembled by LockscreenService::getLockscreenConfig() and is only produced for spaces whose privacy is private. Secret spaces the viewer cannot see return a 404 before the filter runs.

Parameters

#NameTypeDescription
1$lockscreenarrayThe stored lock-screen field definitions.
2$space\FluentCommunity\App\Models\SpaceThe space whose lock screen was requested.

Return: The lock-screen settings array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:996$lockscreen (mixed)
$space (Space)

Example

php
add_filter('fluent_community/get_lockscreen_settings', function ($lockscreen, $space) {
    return $lockscreen;
}, 10, 2);

Related: fluent_community/lockscreen_fields

fluent_community/lockscreen_fields

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the field definitions that make up a space's lock screen.

Each entry has a name, a type such as block or image, and the presentation keys for that type. Core's own callback runs at priority 10 and removes fields whose owning plugin is inactive, matching on namepaywall without FluentCart and welcome_banner without Pro — so register additions at a later priority if you want them to survive. In view-only mode block content has already been passed through the_content and the smart-code parser.

Parameters

#NameTypeDescription
1$fieldsarrayThe lock-screen field definitions.
2$space\FluentCommunity\App\Models\BaseSpaceThe space the lock screen belongs to.

Return: array — a list of field definitions. Return a re-indexed list; the core callback uses array_values().

Call Sites

EditionSourceParameters
Corefluent-community/app/Services/LockscreenService.php:80$settings (mixed)
$space (Space)

Example

php
add_filter('fluent_community/lockscreen_fields', function ($fields, $space) {
    return $fields;
}, 10, 2);

Related: fluent_community/lockscreen_formatted_field · fluent_community/get_lockscreen_settings

fluent_community/lockscreen_formatted_field

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters one lock-screen field after it has been sanitised for storage.

Runs once per submitted field on save. The core sanitiser only keeps a fixed set of keys — the text and colour fields, button_link as a URL, hidden, content for block fields and background_image — so any custom key you added on the read side is dropped before this filter and must be re-attached here. The second argument is the raw submitted field, which is where you will find it.

Parameters

#NameTypeDescription
1$formattedFieldarrayThe sanitised field, ready to store.
2$valuearrayThe raw submitted field, including keys the sanitiser dropped.
3$space\FluentCommunity\App\Models\BaseSpaceThe space being saved.

Return: The field array to store.

Call Sites

EditionSourceParameters
Corefluent-community/app/Services/LockscreenService.php:112$formattedField (mixed)
$value (mixed)
$space (Space)

Example

php
add_filter('fluent_community/lockscreen_formatted_field', function ($formattedField, $value, $space) {
    return $formattedField;
}, 10, 3);

Related: fluent_community/lockscreen_fields

fluent_community/main_menu_items

  • Type: filter
  • Edition: Core
  • Call sites: 2
  • When it fires: Filters the primary navigation items above the space list in the portal sidebar.

Applied at two call sites that both start from the stored mainMenuItems group: the sidebar data builder and the server-side header renderer. Items are keyed by slug — all_feeds, spaces and so on — and the core Course module removes its own entry through this filter when the course feature is off. The mobile bottom bar reads all_feeds and spaces out of the unfiltered group, so removing an item here does not remove it from mobile; use fluent_community/mobile_menu for that.

Parameters

#NameTypeDescription
1$itemsarrayMenu items keyed by slug, each with title, shape_svg and route data.
2$scopestringWhere the menu is being built; sidebar from the sidebar builder.

Return: array — the item map, keyed by slug.

Call Sites

EditionSourceParameters
Corefluent-community/app/Functions/Utility.php:1242$primaryMenuItems (mixed)
$scope (mixed)
Corefluent-community/app/Hooks/Handlers/PortalHandler.php:1200$items (mixed)
$scope (mixed)

Example

php
add_filter('fluent_community/main_menu_items', function ($items, $scope) {
    return $items;
}, 10, 2);

Related: fluent_community/mobile_menu · fluent_community/menu_groups · fluent_community/sidebar_menu_groups_config

fluent_community/menu_groups

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the assembled menu group structure used to render the sidebar.

Applied only when the menu is built with the view context, so the admin menu-settings screen — which uses the editing context — never sees it. By this point links have already been filtered for accessibility against the current user. The array holds four keys: mainMenuItems, profileDropdownItems, beforeCommunityMenuItems and afterCommunityLinkGroups.

Parameters

#NameTypeDescription
1$menuGroupsarrayThe four menu groups: mainMenuItems, profileDropdownItems, beforeCommunityMenuItems, afterCommunityLinkGroups.

Return: array — the group map. Removing a key will break the sidebar builder, which reads all four.

Call Sites

EditionSourceParameters
Corefluent-community/app/Services/Helper.php:1341$menuGroups (mixed)

Example

php
add_filter('fluent_community/menu_groups', function ($menuGroups) {
    return $menuGroups;
}, 10, 1);

Related: fluent_community/main_menu_items · fluent_community/menu_settings_api_response

fluent_community/menu_items_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the sidebar navigation payload the portal fetches to refresh its menu.

The payload is the output of Utility::getPortalSidebarData('sidebar') unwrapped — primaryItems, spaceGroups, settingsItems, topInlineLinks, bottomLinkGroups, is_admin, has_color_scheme and context — not a payload with a menu key. The same structure is filtered one step earlier by fluent_community/sidebar_menu_groups_config, which is also used by the server-rendered sidebar; changes made here affect the REST refresh only.

Parameters

#NameTypeDescription
1$dataarrayThe sidebar data structure.
2$requestDataarrayThe full request parameters.

Return: The sidebar data array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/OptionController.php:31$data (mixed)
$this->request->all() (array)

Example

php
add_filter('fluent_community/menu_items_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/sidebar_menu_groups_config · fluent_community/main_menu_items

fluent_community/menu_settings_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the menu configuration returned to the admin menu-settings screen.

The editing counterpart of fluent_community/menu_items_api_response: it returns the stored configuration including disabled and privacy-restricted entries, because the screen must be able to re-enable them. Groups under afterCommunityLinkGroups have been normalised to title, slug and a re-indexed items list, and groups without a title are dropped.

Parameters

#NameTypeDescription
1$dataarrayResponse payload with a menuSettings structure.
2$requestDataarrayThe full request parameters.

Return: The response payload array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SettingController.php:109$data (mixed)
$request->all() (array)

Example

php
add_filter('fluent_community/menu_settings_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/menu_groups

fluent_community/mobile_menu

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the items in the portal's mobile bottom navigation bar.

Built independently of the sidebar: it looks up only all_feeds and spaces from the stored main menu, falling back to bundled SVGs when a custom icon is not set, then appends either a profile link or, for guests, a login link. Items are a flat, ordered list with route, title and icon_svg, and custom icons have already been through the SVG sanitiser — sanitise any markup you add yourself.

Parameters

#NameTypeDescription
1$mobileMenuItemsarrayOrdered items, each with route or permalink, title and icon_svg.
2$xprofile\FluentCommunity\App\Models\XProfileThe viewing member, or null for a guest.
3$contextstringRender context; headless by default.

Return: array — the ordered item list.

Call Sites

EditionSourceParameters
Corefluent-community/app/Services/Helper.php:1636$mobileMenuItems (mixed)
$xprofile (XProfile)
$context (mixed)

Example

php
add_filter('fluent_community/mobile_menu', function ($mobileMenuItems, $xprofile, $context) {
    return $mobileMenuItems;
}, 10, 3);

Related: fluent_community/main_menu_items

fluent_community/settings_menu

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Collects the entries shown in the sidebar's settings section.

Starts as an empty array and nothing in core adds to it, so the section is absent unless something hooks in. It is resolved once per sidebar build and reaches the portal as settingsItems inside fluent_community/sidebar_menu_groups_config. The user model is null for a logged-out visitor.

Parameters

#NameTypeDescription
1$settingsMenuarrayThe settings entries. Empty by default.
2$userModel\FluentCommunity\App\Models\UserThe current user, or null for a guest.

Return: array — the settings entries.

Call Sites

EditionSourceParameters
Corefluent-community/app/Functions/Utility.php:1237[] (array)
$userModel (mixed)

Example

php
add_filter('fluent_community/settings_menu', function ($settingsMenu, $userModel) {
    return $settingsMenu;
}, 10, 2);

Related: fluent_community/sidebar_menu_groups_config · fluent_community/main_menu_items

fluent_community/space_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the single-space response.

The space has been through formatSpaceData() and fluent_community/space before the filter runs, so it already carries permissions, membership, topics, header_links and — for anyone who is not a space admin — lockscreen_config and a link list narrowed to what the viewer may see. A secret space the viewer has no membership of returns a 404 indistinguishable from a missing space, so the filter never sees it.

Parameters

#NameTypeDescription
1$dataarrayResponse payload with a space key.
2$requestDataarrayThe full request parameters.

Return: The response payload array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:273$data (mixed)
$request->all() (array)

Example

php
add_filter('fluent_community/space_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/space · fluent_community/spaces_api_response

fluent_community/space_groups_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the grouped space tree used by the admin space management screen.

Returns groups, each with its spaces, plus orphaned_spaces for community and course spaces that have no parent group. Community spaces in both lists have been through formatSpaceData(), while courses only get their topics attached. The options_only request variant returns a bare groups list of IDs and titles and is not filtered.

Parameters

#NameTypeDescription
1$dataarrayResponse payload: groups and orphaned_spaces.
2$requestDataarrayThe full request parameters.

Return: The response payload array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:844$data (mixed)
$request->all() (array)

Example

php
add_filter('fluent_community/space_groups_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/all_spaces_api_response

fluent_community/space/create_data

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the attributes a new space is about to be created from.

Applied before Space::create(), so anything you add must be a real column or a cast attribute. The incoming settings have already been sanitised and validated against the chosen privacy, and serial has been computed as the next position within the parent group. Note that this filter takes a single argument — the request payload is not passed, so read it from the request if you need it. Cover photo, logo and topics are attached after creation and are not part of this array.

Parameters

#NameTypeDescription
1$spaceDataarrayThe attributes to create the space with: title, slug, privacy, description, settings, parent_id, serial.

Return: array — the attribute map.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:79array (7 keys: title, slug, privacy, …) (array)

Example

php
add_filter('fluent_community/space/create_data', function ($spaceData) {
    return $spaceData;
}, 10, 1);

Related: fluent_community/space/created · fluent_community/space/update_data

fluent_community/space/join_status_for_private

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the membership status a self-service join produces for a non-public space.

Defaults to pending, which is what makes private spaces require approval. Return active to admit the member immediately — that is how paywall and automation integrations let a purchase grant instant access. The result is whitelisted: anything other than pending or active is coerced back to pending. The filter is skipped for community admins and moderators, who always join as active, and secret spaces are refused before it is reached. The status chosen here decides whether fluent_community/space/join_requested or fluent_community/space/joined fires.

Parameters

#NameTypeDescription
1$statusstringpending by default.
2$space\FluentCommunity\App\Models\SpaceThe space being joined.
3$user\FluentCommunity\App\Models\UserThe joining member.

Return: stringpending or active. Any other value is coerced to pending.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:498'pending' (string)
$space (Space)
$user (User)

Example

php
add_filter('fluent_community/space/join_status_for_private', function ($status, $space, $user) {
    return $status;
}, 10, 3);

Related: fluent_community/space/join_requested · fluent_community/space/joined

fluent_community/space/meta_fields

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Collects extra settings sections to render on a space's settings screen.

Starts as an empty array; each contributor adds one entry keyed by a provider slug, containing section_title, a settings array of current values and a fields array of form field definitions. Saving posts the values back through fluent_community/space/update_meta_settings_{provider}, so the two must use the same key. Rather than filtering directly, prefer FluentExtendApi::addMetaBox(), which wires both sides up for you and works for spaces and courses at once. If nothing is added, the screen shows no additional settings at all.

Parameters

#NameTypeDescription
1$metaFieldsarraySettings sections keyed by provider slug. Empty by default.
2$space\FluentCommunity\App\Models\SpaceThe space whose settings are being rendered.

Return: array — the sections map. Returning an empty array suppresses the meta settings response entirely.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:1006[] (array)
$space (Space)

Example

php
add_filter('fluent_community/space/meta_fields', function ($metaFields, $space) {
    return $metaFields;
}, 10, 2);

Related: fluent_community/course/meta_fields

fluent_community/space/update_data

  • Type: filter
  • Edition: Core
  • Call sites: 1
  • When it fires: Filters the payload a space is about to be updated with.

Applied just before BaseSpace::updateCustomData(), after cover photo and logo URLs have been resolved to claimed media. The array is a request payload rather than a column map — it may carry topic_ids and image URLs alongside real columns — and the same array is passed on to fluent_community/space/updated. An empty parent_id is normalised to an empty string after this filter, so setting it to null here has no effect.

Parameters

#NameTypeDescription
1$dataarrayThe update payload, including non-column keys such as topic_ids, cover_photo and logo.
2$space\FluentCommunity\App\Models\SpaceThe space as currently stored.

Return: array — the update payload.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:345$data (mixed)
$space (Space)

Example

php
add_filter('fluent_community/space/update_data', function ($data, $space) {
    return $data;
}, 10, 2);

Related: fluent_community/space/updated · fluent_community/space/create_data

fluent_community/spaces_api_response

  • Type: filter
  • Edition: Core
  • Call sites: 2
  • When it fires: Filters the listing of spaces the current member belongs to.

Two call sites with different payloads: the bare membership list returns just spaces, while the richer listing adds execution_time and per-space member counts, zeroed where a space hides them from non-members. Neither is the public directory — that is fluent_community/all_spaces_api_response.

Parameters

#NameTypeDescription
1$dataarrayResponse payload with a spaces collection, and execution_time on the richer listing.
2$requestDataarrayThe full request parameters.

Return: The response payload array.

Call Sites

EditionSourceParameters
Corefluent-community/app/Http/Controllers/SpaceController.php:34$data (mixed)
$this->request->all() (array)
Corefluent-community/app/Http/Controllers/SpaceController.php:208$data (mixed)
$request->all() (array)

Example

php
add_filter('fluent_community/spaces_api_response', function ($data, $requestData) {
    return $data;
}, 10, 2);

Related: fluent_community/all_spaces_api_response · fluent_community/space_api_response

fluent_community/update_lockscreen_settings

  • Type: filter
  • Edition: PRO
  • Call sites: 2
  • When it fires: Filters lockscreen (paywall) settings just before they are saved to a space or course.

Shared by both endpoints — PUT /spaces/{spaceSlug}/lockscreens and PUT /admin/courses/{course_id}/lockscreens — so the second argument is a Space on one path and a Course on the other. Branch on the model type if the two need different handling. Runs after LockscreenService::formatLockscreenFields().

Parameters

#NameTypeDescription
1$settingsarrayThe formatted lockscreen fields.
2$target\FluentCommunity\App\Models\BaseSpaceThe Space or Course the lockscreen belongs to.

Return: The lockscreen settings array to persist.

Call Sites

EditionSourceParameters
PROfluent-community-pro/app/Http/Controllers/ProAdminController.php:422$formattedFields (mixed)
$course (Course)
PROfluent-community-pro/app/Http/Controllers/ProAdminController.php:447$formattedFields (mixed)
$space (Space)

Example

php
add_filter('fluent_community/update_lockscreen_settings', function ($settings, $target) {
    return $settings;
}, 10, 2);

FluentCommunity developer documentation