[wp-trac] [WordPress Trac] #63264: Bundled themes: use correct attribute escaping function in block patterns (was: Wrong Escaping Function into the theme)

WordPress Trac noreply at wordpress.org
Fri Apr 11 16:45:44 UTC 2025


#63264: Bundled themes: use correct attribute escaping function in block patterns
---------------------------+-------------------------------
 Reporter:  viralsampat    |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  6.9
Component:  Bundled Theme  |     Version:
 Severity:  normal         |  Resolution:
 Keywords:  needs-patch    |     Focuses:  coding-standards
---------------------------+-------------------------------
Changes (by sabernhardt):

 * keywords:  needs-testing dev-feedback => needs-patch
 * milestone:  Awaiting Review => 6.9


Comment:

 `esc_attr()` is not correct either; these Image blocks should use
 `esc_attr__()` for returning a translation.

 - 63264.patch identifies eight instances of `esc_html__()` for `alt` text
 of 'Gradient' images in Twenty Nineteen's block patterns (r49348).
 - Twenty Fourteen also uses `esc_html__()` for its 'Photo of a sunset'
 image (r51045).
 - Twenty Eleven uses `esc_attr()` for the images' `alt` text (r51103).
 - Twenty Thirteen has a //different// problem with `alt="alt="` for its
 `cylinder-interior` and `bernal-cutaway` images (r51012).
 - Twenty Seventeen does not escape translations in its block patterns
 (r49584).

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


More information about the wp-trac mailing list