[wp-trac] [WordPress Trac] #40245: Youtube embeds lack title attribute

WordPress Trac noreply at wordpress.org
Fri Mar 15 13:01:40 UTC 2019


#40245: Youtube embeds lack title attribute
--------------------------------------+----------------------------
 Reporter:  morriscountynj            |       Owner:  swissspidy
     Type:  enhancement               |      Status:  assigned
 Priority:  normal                    |   Milestone:  5.2
Component:  Embeds                    |     Version:  2.9
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  accessibility
--------------------------------------+----------------------------

Comment (by jrf):

 @afercia Shoot, yes, you're right. I shouldn't be doing twenty things at
 the same time.

 Ok, what about this: (though you run the risk of replacing the title in
 other HTML elements too if it would be ''exactly'' the same)

 {{{#!php
 <?php
 if ( $has_title_attr ) {
         // Remove the old title.
         $result = str_replace( ' title=' . $matches[1] . $matches[2] .
 $matches[1], '', $result );
 }

 return str_ireplace( '<iframe ', sprintf( '<iframe title="%s" ', esc_attr(
 $title ) ), $result );
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40245#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list