Add tabindex to image links if title is included

This commit is contained in:
Robin Cornett
2020-01-14 08:57:07 -05:00
parent 50cb27d8f4
commit e5cbdc2289
2 changed files with 2 additions and 2 deletions
@@ -124,7 +124,7 @@ class DisplayFeaturedImageGenesisOutputCPT {
}
$image = $this->get_image( $title );
if ( $image ) {
$role = empty( $this->instance['show_title'] ) ? '' : 'aria-hidden="true"';
$role = empty( $this->instance['show_title'] ) ? '' : 'aria-hidden="true" tabindex="-1"';
printf( '<a href="%s" title="%s" class="%s" %s>%s</a>', esc_url( $permalink ), esc_html( $title ), esc_attr( $this->instance['image_alignment'] ), $role, $image );
}
}
@@ -95,7 +95,7 @@ class DisplayFeaturedImageGenesisOutputTerm {
);
if ( $this->instance['show_image'] && $image ) {
$role = empty( $this->instance['show_title'] ) ? '' : 'aria-hidden="true"';
$role = empty( $this->instance['show_title'] ) ? '' : 'aria-hidden="true" tabindex="-1"';
printf( '<a href="%s" title="%s" class="%s" %s>%s</a>', esc_url( $permalink ), esc_html( $title ), esc_attr( $this->instance['image_alignment'] ), $role, wp_kses_post( $image ) );
}
}