BoothExplorerShortcode
in package
Table of Contents
Properties
Methods
- __construct() : mixed
- register() : void
- Register shortcode.
- render() : string
- Render shortcode output.
- buildCriteria() : BoothSearchCriteria
- Build Criteria.
- fetchRelatedItems() : array<string|int, mixed>
- Fetch Related Items.
- getAttachedItems() : array<string|int, WP_Post>
- Fetches up to three attached booth items for preview cards.
- mapBoothCard() : array<string|int, mixed>
- Map a booth post to view data for the explorer card.
Properties
$boothItemRepository
private
BoothItemRepository
$boothItemRepository
$searchService
private
BoothAndItemSearch
$searchService
Methods
__construct()
public
__construct(BoothAndItemSearch $searchService, BoothItemRepository $boothItemRepository) : mixed
Parameters
- $searchService : BoothAndItemSearch
-
Search service.
- $boothItemRepository : BoothItemRepository
-
Booth item repository.
register()
Register shortcode.
public
register() : void
render()
Render shortcode output.
public
render([array<string|int, mixed> $atts = [] ]) : string
Attributes:
- category: Topic slug to preselect (optional).
- per_page: Items per page (default 9).
- headline / intro: Text above the grid.
- show_related: true|false – render related exhibits box.
- related_limit: How many related exhibits to fetch.
- scope: booths_only | items_only | booths_and_items (search target).
Parameters
- $atts : array<string|int, mixed> = []
-
Shortcode attributes.
Return values
stringbuildCriteria()
Build Criteria.
private
buildCriteria(string $searchQuery, string $selectedCategory, int $page, int $perPage, string $scope) : BoothSearchCriteria
Parameters
- $searchQuery : string
- $selectedCategory : string
- $page : int
- $perPage : int
- $scope : string
Return values
BoothSearchCriteriafetchRelatedItems()
Fetch Related Items.
private
fetchRelatedItems(bool $showRelated, string $selectedCategory, int $relatedLimit) : array<string|int, mixed>
Parameters
- $showRelated : bool
- $selectedCategory : string
- $relatedLimit : int
Return values
array<string|int, mixed>getAttachedItems()
Fetches up to three attached booth items for preview cards.
private
getAttachedItems(BoothId $boothId) : array<string|int, WP_Post>
Parameters
- $boothId : BoothId
Return values
array<string|int, WP_Post>mapBoothCard()
Map a booth post to view data for the explorer card.
private
mapBoothCard(Booth $booth) : array<string|int, mixed>
Parameters
- $booth : Booth