[wp-trac] [WordPress Trac] #30319: Twenty Fifteen: Incorrect use of sprintf() and _x() in template-tags.php

WordPress Trac noreply at wordpress.org
Wed Nov 12 23:38:08 UTC 2014


#30319: Twenty Fifteen: Incorrect use of sprintf() and _x() in template-tags.php
---------------------------+---------------------
 Reporter:  aprea          |       Owner:
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:  4.1
Component:  Bundled Theme  |     Version:  trunk
 Severity:  normal         |  Resolution:  fixed
 Keywords:  has-patch      |     Focuses:
---------------------------+---------------------
Changes (by dd32):

 * milestone:  Awaiting Review => 4.1


Comment:

 FWIW, @aprea, I was thinking something like this, not using the extra
 sprintf:
 {{{
 printf( '<span class="full-size-link">%1$s<a href="%2$s">%3$s ×
 %4$s</a></span>',
                 '<span class="screen-reader-text">' . _x( 'Full size',
 'Used before full size attachment link.', 'twentyfifteen' ) . '</span>',
                 esc_url( wp_get_attachment_url() ),
                 $metadata['width'],
                 $metadata['height']
         );
 }}}
 Of course, it's fine-as-is in r30312 :)

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


More information about the wp-trac mailing list