mirror of
https://gh.wpcy.net/https://github.com/lubusIN/blablablocks-tabs-block.git
synced 2026-05-04 14:22:20 +08:00
29 lines
No EOL
787 B
PHP
29 lines
No EOL
787 B
PHP
<?php
|
|
|
|
/**
|
|
* Render the tab block.
|
|
*
|
|
* @param array $attributes Block attributes.
|
|
* @param string $content Block content.
|
|
* @param WP_Block $block Block instance.
|
|
*
|
|
* @package BlaBlaBlocks Tabs Block
|
|
*/
|
|
|
|
if (! defined('ABSPATH')) {
|
|
exit; // Exit if accessed directly.
|
|
}
|
|
|
|
$wrapper_attributes = get_block_wrapper_attributes([
|
|
'id' => esc_attr('tab-' . $attributes['tabId']),
|
|
'class' => esc_attr('blablablocks-tab-content'),
|
|
'role' => "tabpanel",
|
|
'tabindex' => "0",
|
|
'data-wp-bind--hidden' => "!state.isActive",
|
|
'aria-labelledby' => esc_attr('tab-' . $attributes['tabId'])
|
|
]);
|
|
?>
|
|
<div <?php echo wp_kses_data($wrapper_attributes); ?>>
|
|
<?php echo $content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
|
|
?>
|
|
</div>
|