| @@ -39,8 +39,11 @@ | ||
| 39 | 39 | 'per_page' => 10, |
| 40 | 40 | 'columns' => 3, |
| 41 | 41 | 'title' => 'Our Trips', |
| 42 | 42 | 'show_pagination' => true, |
| 43 | + // Per-instance card layout. 'inherit' = use the site-wide setting. | |
| 44 | + 'card_layout' => 'inherit', | |
| 45 | + 'cardLayout' => '', | |
| 43 | 46 | 'destinationIds' => [], |
| 44 | 47 | 'activityIds' => [], |
| 45 | 48 | 'categoryIds' => [], |
| 46 | 49 | 'difficultyIds' => [], |
| @@ -186,8 +189,22 @@ | ||
| 186 | 189 | |
| 187 | 190 | $atts['title'] = sanitize_text_field((string) ($atts['title'] ?? 'Our Trips')); |
| 188 | 191 | |
| 189 | 192 | $atts['show_pagination'] = self::coerceToBool($atts['show_pagination'] ?? true, true) ? 'yes' : 'no'; |
| 193 | + | |
| 194 | + // Card layout override. Accept camelCase (Gutenberg block: cardLayout) | |
| 195 | + // and snake_case (shortcode: card_layout). Unknown/empty/"inherit" keeps | |
| 196 | + // 'inherit' so the template falls back to the site-wide Design setting. | |
| 197 | + $cardLayoutRaw = ''; | |
| 198 | + if (isset($atts['cardLayout']) && is_string($atts['cardLayout']) && $atts['cardLayout'] !== '') { | |
| 199 | + $cardLayoutRaw = $atts['cardLayout']; | |
| 200 | + } elseif (isset($atts['card_layout']) && is_string($atts['card_layout']) && $atts['card_layout'] !== '') { | |
| 201 | + $cardLayoutRaw = $atts['card_layout']; | |
| 202 | + } | |
| 203 | + $cardLayoutRaw = strtolower(trim($cardLayoutRaw)); | |
| 204 | + $atts['card_layout'] = in_array($cardLayoutRaw, ['standard', 'compact_mobile', 'compact_all'], true) | |
| 205 | + ? $cardLayoutRaw | |
| 206 | + : 'inherit'; | |
| 190 | 207 | |
| 191 | 208 | // Featured Priority (matches admin form: featured | new | limited; "none"/empty = no filter). |
| 192 | 209 | // Accept both snake_case (shortcode) and camelCase (Gutenberg block attribute). |
| 193 | 210 | $featuredPriorityRaw = ''; |