wp-includes/blocks/tab-list.php:24Render callback for core/tab-list.
$attributesarray$contentstring$blockWP_Blockstringfunction block_core_tab_list_render_callback( array $attributes, string $content, \WP_Block $block ): string { $tabs_list = $block->context['core/tabs-list'] ?? array(); $aria_label = empty( $attributes['ariaLabel'] ) ? __( 'Tabbed content' ) : wp_strip_all_tags( $attributes['ariaLabel'] ); $tag_processor = new WP_HTML_Tag_Processor( $content ); if ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-tab-list' ) ) ) { $tag_processor->set_attribute( 'aria-label', $aria_label ); } if ( empty( $tabs_list ) ) { return $tag_processor->get_updated_html(); } $tab_index = 0; while ( $tag_processor->next_tag( 'button' ) ) { $tab_id = $tabs_list[ $tab_index ] ?? null; if ( null === $tab_id ) { break; } $tag_processor->set_attribute( 'id', 'tab__' . $tab_id ); $tag_processor->set_attribute( 'aria-controls', $tab_id ); $tag_processor->set_attribute( 'data-wp-on--click', 'actions.handleTabClick' ); $tag_processor->set_attribute( 'data-wp-on--keydown', 'actions.handleTabKeyDown' ); $tag_processor->set_attribute( 'data-wp-bind--aria-selected', 'state.isActiveTab' ); $tag_processor->set_attribute( 'data-wp-bind--tabindex', 'state.tabIndexAttribute' ); $tag_processor->set_attribute( 'data-wp-context', wp_json_encode( array( 'tabIndex' => $tab_index ) ) ); ++$tab_index; } return $tag_processor->get_updated_html();}Introduced in 7.1.0.
Signature, return type and hooks compared across 1 parsed release.
src/wp-includes/blocks/tab-list.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.