/home/desid573/verdenaturopathy.com.au/site2/wp-includes/blocks
Edit: /home/desid573/verdenaturopathy.com.au/site2/wp-includes/blocks/tabs.php (3949B)
context['core/tabs-list'] ?? array();
$tabs_id = $block->context['core/tabs-id'] ?? null;
if ( empty( $tabs_id ) ) {
// If malformed tabs, return early to avoid errors.
return '';
}
$tag_processor = new WP_HTML_Tag_Processor( $content );
$tag_processor->next_tag( array( 'class_name' => 'wp-block-tabs' ) );
$tag_processor->set_attribute( 'data-wp-interactive', 'core/tabs' );
$tag_processor->set_attribute(
'data-wp-context',
wp_json_encode(
array(
'tabsId' => $tabs_id,
'activeTabIndex' => $active_tab_index,
)
)
);
$tag_processor->set_attribute( 'data-wp-init', 'callbacks.onTabsInit' );
$tag_processor->set_attribute( 'data-wp-on--keydown', 'actions.handleTabKeyDown' );
$output = $tag_processor->get_updated_html();
/**
* Builds a client side state for just this tabs instance, so each
* core/tabs block manages its own state, like context.
*/
wp_interactivity_state(
'core/tabs',
array(
$tabs_id => $tabs_list,
)
);
return $output;
}
/**
* Registers the `core/tabs` block on the server.
*
* @since 7.1.0
*/
function register_block_core_tabs() {
register_block_type_from_metadata(
__DIR__ . '/tabs',
array(
'render_callback' => 'block_core_tabs_render_block_callback',
)
);
}
add_action( 'init', 'register_block_core_tabs' );