AmeliaBookingButtonRendererTrait.php
3 months ago
AmeliaBookingModule.php
1 day ago
AmeliaCatalogBookingModule.php
1 day ago
AmeliaCatalogModule.php
1 day ago
AmeliaCatalogShortcodeHelper.php
1 day ago
AmeliaCustomerPanelModule.php
1 day ago
AmeliaEmployeePanelModule.php
1 day ago
AmeliaEventsCalendarModule.php
1 day ago
AmeliaEventsListBookingButtonModule.php
1 day ago
AmeliaEventsListModule.php
1 day ago
AmeliaEventsModule.php
1 day ago
AmeliaSearchModule.php
1 day ago
AmeliaStepBookingButtonModule.php
1 day ago
AmeliaStepBookingModule.php
1 day ago
ModuleMetadata.php
2 months ago
SharedShortcodeModule.php
2 months ago
index.php
1 day ago
AmeliaCatalogShortcodeHelper.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Divi5Amelia; |
| 4 | |
| 5 | /** |
| 6 | * Shared catalog shortcode helpers for Divi 5 renderers. |
| 7 | */ |
| 8 | class AmeliaCatalogShortcodeHelper |
| 9 | { |
| 10 | /** |
| 11 | * Build the show= fragment for catalog-booking shortcodes. |
| 12 | * |
| 13 | * Mirrors TinyMCE (catalogbooking) and Elementor catalog-booking gating. |
| 14 | * |
| 15 | * @param string $catalogView |
| 16 | * @param mixed|null $typeValue |
| 17 | * |
| 18 | * @return string |
| 19 | */ |
| 20 | public static function buildCatalogBookingShowAttribute(string $catalogView, $typeValue): string |
| 21 | { |
| 22 | if ($typeValue === null || $typeValue === '' || $typeValue === '0') { |
| 23 | return ''; |
| 24 | } |
| 25 | |
| 26 | if ($catalogView === 'package') { |
| 27 | return ''; |
| 28 | } |
| 29 | |
| 30 | if ($catalogView === 'service' && $typeValue === 'packages') { |
| 31 | return ''; |
| 32 | } |
| 33 | |
| 34 | return ' show=' . esc_attr((string) $typeValue); |
| 35 | } |
| 36 | } |
| 37 |