class Matches extends Kernowdev\Clanbite\Extensions\SkeletonRegisters the cp_match post type, REST routes, block libraries, and editor meta UI hooks.
class
- Full name
Kernowdev\Clanbite\Extensions\Matches- Extends
Kernowdev\Clanbite\Extensions\Skeleton
Constants
| Name | Value | Description |
|---|---|---|
POST_TYPE | 'clanbite_match' | Match post type slug. |
STATUS_SCHEDULED | 'scheduled' | |
STATUS_LIVE | 'live' | |
STATUS_FINISHED | 'finished' | |
STATUS_CANCELLED | 'cancelled' | |
VISIBILITY_PUBLIC | 'public' | Visibility levels for matches (and match-backed schedule events). |
VISIBILITY_MEMBERS | 'members' | |
VISIBILITY_TEAM_MEMBERS | 'team_members' | |
VISIBILITY_TEAM_ADMINS | 'team_admins' |
Methods
__construct()Construct extension metadata and register on the official extensions filter.build_block_meta_query()Build a meta_query fragment for list blocks (optional team + status).collect_team_ids_from_match_posts()Collect referenced clanbite_team IDs from match posts for cache priming.enqueue_match_editor()Enqueue the block editor script that registers the Match details document sidebar.events_can_view_match_attendees()Allow team members/admins to view match attendee lists when hidden.filter_team_front_action_matches_slug()Add the matches segment to team directory rewrites when the team Matches subpage is enabled.get_settings_admin()Settings handler for the unified React admin (own tab: root extension).get_status_choices()Localized labels for match status keys.match_admin_columns()Insert custom columns after the title on the match list screen.match_to_rest_array()Shape a match post for REST consumers and internal use.maybe_single_match_template()Use the plugin single template for match permalinks when the theme has no override.meta_auth_edit_post()Limit meta writes in REST/editor to users who can edit the post.prime_team_post_cache_for_match_posts()Prime team post cache for all matches in a batch (SSR lists, REST collections).prime_team_post_cache()Prime WordPress post cache for team rows referenced by matches (reduces per-row get_post() overhead).register_match_block_libraries()Load Match list and Match card blocks from the plugin root build/matches bundle (metadata collection).register_match_meta()Register post meta with REST exposure; editor fields are rendered in JS (see enqueue_match_editor).register_match_post_type()Register the public cp_match post type.register_team_create_matches_step()Append the Matches step to the front-end team registration wizard when this extension is active.register_team_matches_subpage()Register the team profile Matches tab when Teams uses directory URLs.render_card_block_markup()HTML for the Match card block (render.php entry point).render_list_block_markup()HTML for the Match list block (render.php entry point).render_match_admin_column()Output HTML for a single admin list column.render_notice_missing_match_assets()Admin notice when block build output is missing (run package npm run build).run_installer()Ensure rewrite rules exist after the extension is first enabled.run_uninstaller()Remove all match posts and flush rewrites when the extension is disabled.run_updater()Run migrations when the bundled extension version increases.run()Wire WordPress hooks for CPT, meta, blocks, REST, admin list columns, and editor assets.sanitize_match_attendees_visibility()Restrict attendees visibility meta to known slugs.sanitize_match_status()Restrict status meta to known slugs.sanitize_match_visibility()Restrict visibility meta to known slugs.sanitize_scheduled_at()Normalize scheduled datetime meta to GMT MySQL format.setup_extension()Register as a first-party (whitelisted) extension instead of a third-party filter entry.validate_match_on_save()Strip invalid team IDs and ensure a default schedule time on save.viewer_can_see_match()Whether the current viewer may see a match.
Defined in inc/extensions/matches/class-extension-matches.php
Changelog
| Version | Description |
|---|---|
| 1.3.0 | Updated. |