From 1b5c8a1ff5e8cefcca6e98bb18cdec9547e5a3fc Mon Sep 17 00:00:00 2001 From: josh Date: Thu, 12 Nov 2026 15:10:53 -0500 Subject: [PATCH] Add sub-club selection to the WordPress event editor --- README.md | 2 ++ burn-events.php | 4 ++-- includes/class-admin.php | 32 ++++++++++++++++++++++++++++++++ includes/class-clubs.php | 12 ++++++++++++ 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 168835a..6250c06 100644 --- a/README.md +++ b/README.md @@ -43,3 +43,5 @@ Use `GET /events` to list records, `POST /events` to create one, and `PATCH /eve Sync a named club or sub-club with `PUT /burnworks/workspaces/{workspace_id}/clubs/{club_id}`. Send events to `PUT /burnworks/workspaces/{workspace_id}/events/{event_id}` with the burnWorks `club_id`. An event stores its workspace and club identity in a hidden field. In Elementor, use **Club or sub-club** on **Event Calendar** and **Event List** to show a whole workspace or one club. See the [API reference](docs/API.md) for routes, payloads, and errors, and the [burnWorks handoff](docs/BURNWORKS-INTEGRATION.md) for field mapping and publishing rules. The [feature and settings audit](docs/PARITY-AUDIT.md) records the current coverage against the reference packages. + +For events created in WordPress, use **Event Details → Sub-club** to select a club from the synced burnWorks directory. Events created in burnWorks keep their assignment from that system. diff --git a/burn-events.php b/burn-events.php index f81c3d5..6d6b4c0 100644 --- a/burn-events.php +++ b/burn-events.php @@ -3,7 +3,7 @@ * Plugin Name: eventLabs * Plugin URI: https://git.labs.casa/josh/eventLabs * Description: Calendars, recurring events, community submissions, and a Single Event template builder for Elementor. - * Version: 0.5.4 + * Version: 0.5.5 * Requires at least: 6.9 * Requires PHP: 8.1 * Author: hostLabs @@ -16,7 +16,7 @@ declare(strict_types=1); defined( 'ABSPATH' ) || exit; define( 'BURN_EVENTS_FILE', __FILE__ ); -define( 'BURN_EVENTS_VERSION', '0.5.4' ); +define( 'BURN_EVENTS_VERSION', '0.5.5' ); foreach ( [ 'schedule', 'maps', 'events', 'admin', 'map-view', 'calendar-grid', 'calendar', 'community', 'transfer', 'single-event-templates', 'api', 'burnworks', 'clubs', 'legacy-migration', 'updates', 'platform' ] as $module ) { require_once __DIR__ . '/includes/class-' . $module . '.php'; diff --git a/includes/class-admin.php b/includes/class-admin.php index 4730ab5..5ee36a2 100644 --- a/includes/class-admin.php +++ b/includes/class-admin.php @@ -177,6 +177,30 @@ final class Admin { $data['organizer'] = array_filter( [ $options['organizer'] ] ); } self::event_fields( $data ); + $scope = (string) get_post_meta( $post->ID, Clubs::EVENT_META, true ); + $options = Clubs::editor_options(); + ?> +


+

+

ID ) ) { + esc_html_e( 'This assignment is managed in burnWorks.', 'burn-events' ); + } elseif ( ! $options ) { + esc_html_e( 'Connect burnWorks and sync its club directory to populate this list.', 'burn-events' ); + } else { + esc_html_e( 'This determines which CRM sub-club receives the event.', 'burn-events' ); + } + ?>

+ getMessage(), MINUTE_IN_SECONDS ); } diff --git a/includes/class-clubs.php b/includes/class-clubs.php index 74c862d..d4ff2d2 100644 --- a/includes/class-clubs.php +++ b/includes/class-clubs.php @@ -151,6 +151,18 @@ final class Clubs { return [ '' => __( 'All events', 'burn-events' ) ] + $workspaces + $clubs; } + public static function editor_options(): array { + $options = []; + foreach ( self::directory() as $club ) { + if ( 'archived' !== $club['status'] ) { + $prefix = $club['workspace_name'] ?: sprintf( __( 'Workspace %s', 'burn-events' ), substr( $club['workspace_id'], 0, 8 ) ); + $options[ $club['scope'] ] = $prefix . ' / ' . $club['name']; + } + } + natcasesort( $options ); + return $options; + } + public static function condition( string $scope ): string { global $wpdb; $scope = strtolower( $scope );