__CLASS__, 'attributes' => $attributes, 'block_ids' => self::$block_ids, ] ); if ( ! class_exists( 'WP_HTML_Tag_Processor' ) ) { return $block_content; } $processor = new WP_HTML_Tag_Processor( $block_content ); $tag_name = $attributes['tagName'] ?? 'div'; $main_tag = $processor->next_tag( $tag_name ); $updated_html = false; if ( $processor && $main_tag ) { if ( $attributes['tabItemOpen'] ) { $processor->add_class( 'gb-block-is-current' ); $updated_html = true; } if ( 'div' === $tag_name ) { if ( ! $processor->get_attribute( 'tabindex' ) ) { $processor->set_attribute( 'tabindex', '0' ); } if ( ! $processor->get_attribute( 'role' ) ) { $processor->set_attribute( 'role', 'button' ); } $updated_html = true; } if ( $updated_html ) { $block_content = $processor->get_updated_html(); } } return $block_content; } }