wp-includes/blocks/tabs.php:83Render callback for core/tabs.
$attributesarray$contentstring$blockWP_Blockstringfunction block_core_tabs_render_block_callback( array $attributes, string $content, \WP_Block $block ): string { $active_tab_index = $attributes['activeTabIndex'] ?? 0; $tabs_list = $block->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;}Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/blocks/tabs.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.