Add sub-club selection to the WordPress event editor
All checks were successful
WordPress release / release (push) Successful in 6s

This commit is contained in:
josh
2026-11-12 15:10:53 -05:00
parent 2ace78b669
commit 1b5c8a1ff5
4 changed files with 48 additions and 2 deletions

View File

@@ -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 );