Developer & API

Gather Grove Communities is built to be extended. This page is the orientation; the precise, versioned contracts (exact hook signatures and REST schemas) ship with the plugin source and are kept current there.

Conventions

  • Hook prefix: gather_grove/communities/ (slash-style).
  • REST namespace: /wp-json/gather-grove/communities/v1/.
  • PHP namespace: GatherGroveCommunities. Text domain / CSS prefix: gather-grove-communities / .gg-communities-.
  • Options, scripts and globals: every option, transient, admin action, query variable, shortcode, script/style handle and constant uses gather_grove_communities_ (gather-grove-communities- for handles, GATHER_GROVE_COMMUNITIES_ for constants, gatherGroveCommunities… for JavaScript globals). Before 1.75.0 these were gg_communities_ / gg-communities- / GG_COMMUNITIES_ / ggCommunities…, ggCampfire, ggMessagesPanel, ggPoll and ggLinkify; the 1.75.0 update moves a site’s stored settings across on its own, and code of yours that read an old name needs the new one. The settings live in one option per group, gather_grove_communities_{group} (core’s SettingsManager::for( 'gather_grove_communities' )).
  • Shortcode: (was [gg_community_controls]; the update rewrites the old tag in your pages, Elementor templates and text widgets).
  • Capabilities: gg_manage_communities, gg_moderate_communities, gg_post_in_spaces, gg_view_member_directory, gg_view_own_profile, gg_message_any_instructor, gg_message_any_member, gg_create_spaces. Subscribers and Booking’s client and instructor roles get the member three (post, own profile, directory) on activation; WordPress Administrators and Booking’s Gather Grove Admin, Gather Grove Manager and Studio Director roles get the full set.

React to community events

Action hooks announce the domain lifecycle — space_created, space_archived, member_joined_space, member_left_space, post_published, post_deleted, member_intro_published, instructor_thread_message (all under the gather_grove/communities/ prefix). Communities also emits to the ecosystem-wide gather_grove/activity bus, which is how sibling plugins’ events reach member timelines.

Adjust the rules

Filters give you final say over policy decisions: can_post_in_space, can_view_profile, instructor_channel_eligible, should_spawn_cohort_space, post_rate_limit, member_space_cap (the per-creator request limit), feed_retention_days, pre_class_retention, feed_visibility, intros_enabled, intro_template, url_base, member_dm_eligible, should_spawn_lobby, course_instructor_ids and cohort_course_id — again all prefixed gather_grove/communities/.

gather_grove/communities/url_base is the programmatic answer to the community address, for a site whose base is decided by code rather than by the settings screen. It runs after the stored value is sanitized and its return is sanitized again on the way out — the string is concatenated into a rewrite regex and into home_url(), so “you may return anything” is not “nothing is checked”. The legacy spaces base keeps redirecting whatever you set.

Shape the rooms

  • Post kinds — post_kinds registers your own kind (label, description, moderators_only, votes); space_post_kinds decides which are available in a given room. The post kind can never be unregistered. See Announcements & proposals.
  • Writing limits — post_max_length and comment_max_length.
  • Room chrome — room_body_class adds classes to a room document; portal_url points “back to your rooms” at your own member portal.
  • Identity — avatar_attachment_id supplies a member’s photograph from your own source (Booking’s instructor and client photos ride this); member_role_label relabels the instructor and moderator badges for studios that use different words.
  • Invitations — invite_ttl_days, invite_redirect_url, invite_email_subject, invite_email_body.

Portal tabs

Communities renders inside Booking’s dashboards through Booking’s tab seams — the client dashboard, and (Booking 1.65.0+) the instructor dashboard, which is what puts a facilitator’s rooms where facilitators actually work. Any plugin can add instructor tabs the same way; see the Booking developer docs.

The public API

Two static facades exist for sibling plugins (call them behind class_exists):

  • GatherGroveCommunitiesPublicApiReflections::share( $member_id, $cohort_id, $course_lesson_id, $content ) — publishes a lesson reflection into the member’s cohort space; returns the post id, or 0 when there’s no postable cohort space (hide the affordance).
  • GatherGroveCommunitiesPublicApiDiscussions::render( $course_lesson_id, $viewer_id ) — returns the lesson-scoped discussion HTML, or '' when the viewer may see nothing.

Merging duplicate members

Before a Gather Grove plugin (Pulse) folds a duplicate account into another and deletes it, it asks every plugin that keeps per-member data whether the duplicate holds any. That matters more here than anywhere: when a WordPress account is deleted, Communities removes its room seats, profile, settings and private conversations, and everything it wrote stays behind as “A member”. Communities answers both suite-wide filters:

  • gather_grove/member/merge_blockers ( $blockers, $duplicate_id, $keeper_id ) — Communities appends one { plugin: 'gather-grove-communities', code, message, reverse } entry for each kind of record the duplicate holds. Codes: room_memberships, rooms_started, posts, comments, reactions (on posts, comments and campfire messages), votes, campfire_messages, intros, resources_added, invitations_sent, joined_by_invitation, profile (only when something was filled in), community_settings (only when a setting was changed), and with Communities Professional direct_messages, instructor_messages, member_blocks and reports_filed; could_not_check when a read fails. reverse is true when the other account holds none of these, so merging the other way round would keep everything. Asking changes nothing.
  • gather_grove/member/merge_responders ( $slugs ) — Communities adds gather-grove-communities, so the asking plugin can tell an account with nothing here from a Communities version that does not answer.

A member’s activity timeline is not counted: each entry is a copy of an event another plugin owns and answers for itself, and almost every account has some. The duplicate’s own timeline entries are removed with the account.

REST

Everything the surfaces do goes through REST: spaces and rosters (/spaces, /spaces/{id}, /spaces/{id}/approval, /spaces/{id}/members, …/members/{id}, …/members/{id}/moderation), posts (/posts, /posts/{id}, plus /comments, /reactions, /support, /moderation), the feed (/feed, cursor-paginated), profiles (/profiles/{member_id}, …/settings, /directory), resources (/spaces/{id}/resources), intros (/intros, /intros/{space_id}), instructor threads (/instructor-threads, …/{thread_id}, and the message routes), member messages (/dms, /dms/recipients, /dms/{member_id}/messages, …/read, …/report, /members/{member_id}/block), the combined inbox (/messages), and campfires (/campfires and its routes). All routes require authentication; writes check the same policy objects the widgets use — there is no privileged path around membership, moderation state, or consent.

Data

Communities owns its own tables (prefixed gg_communities_ — table names, capabilities, meta keys and Elementor widget names keep their original names, because renaming them would orphan stored data). Uninstall never destroys data unless you opt in via the gather_grove_communities_uninstall_data option (gg_communities_uninstall_data before 1.75.0).

WP-CLI

wp gg-communities roster (review, show, remove, seat-instructors) and wp gg-communities member purge. Anything that changes data reports what it would do and changes nothing until you add --confirm. See Roster review.


Applies to Gather Grove Communities v1.78.0. Last synced October 15, 2026.