Recommend the_title_attribute() instead of esc_attr( get_the_title() )
Is your feature request related to a problem?
the_title_attribute() automatically strips tags from get_the_title() and escapes the echoed or returned value ready for it to be added to an attribute.
We should recommend (WordPress-Extra) that the_title_attribute() be used instead of esc_attr( get_the_title() ), perhaps with a slightly different message for when that is proceeded by an echo or <?php=.
<img src="..." alt="<?php echo esc_attr( get_the_title() ) ?>">
=>
<img src="..." alt="<?php the_title_attribute(); ?>">
@GaryJones Should this be added to #1315 as one of the cases to look for ?
Yes, can do.
This would be very welcome, as a lot of plugins get it wrong. wp-Typography optionally injects HTML into the_title and when themes or plugins don't expect that, people get upset.