Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tristanmason/575bcbe29738019bd6b9adacc1257f77 to your computer and use it in GitHub Desktop.
Save tristanmason/575bcbe29738019bd6b9adacc1257f77 to your computer and use it in GitHub Desktop.
Always show aria-label for accessibility on Astra header builder social icons
<?php // class-astra-builder-ui-controller.php | Line 92
echo '<a href="' . esc_url( $link ) . '"' . esc_attr( $item['label'] ? ' aria-label=' . $item['label'] . '' : ' aria-label=' . $item['id'] . '' ) . ' ' . ( 'phone' === $item['id'] || 'email' === $item['id'] ? '' : 'target="_blank" rel="noopener noreferrer" ' ) . 'style="--color: ' . esc_attr( ! empty( $item['color'] ) ? $item['color'] : '#3a3a3a' ) . '; --background-color: ' . esc_attr( ! empty( $item['background'] ) ? $item['background'] : 'transparent' ) . ';" class="ast-builder-social-element ast-inline-flex ast-' . esc_attr( $item['id'] ) . ' ' . esc_attr( $builder_type ) . '-social-item">';
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment