Add sub-club selection to the WordPress event editor
All checks were successful
WordPress release / release (push) Successful in 6s
All checks were successful
WordPress release / release (push) Successful in 6s
This commit is contained in:
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user