| 1 |
<?php |
| 2 |
/** |
| 3 |
* Shared later-settings breadcrumb for Setup Wizard steps. |
| 4 |
* |
| 5 |
* @package Booking Calendar |
| 6 |
* @var array<string,mixed> $template_context Authorized hint context. |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; |
| 11 |
} |
| 12 |
|
| 13 |
$settings_hint = isset( $template_context['settings_hint'] ) && is_array( $template_context['settings_hint'] ) |
| 14 |
? $template_context['settings_hint'] |
| 15 |
: array(); |
| 16 |
$message = isset( $settings_hint['message'] ) && is_scalar( $settings_hint['message'] ) ? (string) $settings_hint['message'] : ''; |
| 17 |
$links = isset( $settings_hint['links'] ) && is_array( $settings_hint['links'] ) ? $settings_hint['links'] : array(); |
| 18 |
$renderable_links = array(); |
| 19 |
|
| 20 |
foreach ( $links as $link ) { |
| 21 |
$link_label = isset( $link['label'] ) && is_scalar( $link['label'] ) ? (string) $link['label'] : ''; |
| 22 |
$link_url = isset( $link['url'] ) && is_scalar( $link['url'] ) ? (string) $link['url'] : ''; |
| 23 |
if ( '' !== $link_label && '' !== $link_url ) { |
| 24 |
$renderable_links[] = array( |
| 25 |
'label' => $link_label, |
| 26 |
'url' => $link_url, |
| 27 |
); |
| 28 |
} |
| 29 |
} |
| 30 |
|
| 31 |
if ( '' !== $message && ! empty( $renderable_links ) ) : |
| 32 |
?> |
| 33 |
<aside class="wpbc_setup_wizard__settings-hint" role="note"> |
| 34 |
<span class="wpbc_setup_wizard__settings-hint-message"><?php echo esc_html( $message ); ?> <span aria-hidden="true">—</span></span> |
| 35 |
<nav class="wpbc_setup_wizard__settings-hint-path" aria-label="<?php esc_attr_e( 'Where to change these settings later', 'booking' ); ?>"> |
| 36 |
<?php foreach ( $renderable_links as $link_index => $link ) : ?> |
| 37 |
<?php if ( 0 < $link_index ) : ?> |
| 38 |
<span class="wpbc_setup_wizard__settings-hint-separator" aria-hidden="true">›</span> |
| 39 |
<?php endif; ?> |
| 40 |
<a href="<?php echo esc_url( $link['url'] ); ?>"><?php echo esc_html( $link['label'] ); ?></a> |
| 41 |
<?php endforeach; ?> |
| 42 |
</nav> |
| 43 |
</aside> |
| 44 |
<?php |
| 45 |
endif; |
| 46 |
|