- <h3 id="mw-vector-current-variant">
- <?php
- foreach ( $this->data['variant_urls'] as $link ) {
- ?>
- <?php
- if ( stripos( $link['attributes'], 'selected' ) !== false ) {
- ?>
- <?php
- echo htmlspecialchars( $link['text'] )
- ?>
- <?php
- }
- ?>
- <?php
+ <?php
+ // Replace the label with the name of currently chosen variant, if any
+ $variantLabel = $this->getMsg( 'variants' )->text();
+ foreach ( $this->data['variant_urls'] as $link ) {
+ if ( stripos( $link['attributes'], 'selected' ) !== false ) {
+ $variantLabel = $link['text'];
+ break;