[wp-trac] [WordPress Trac] #53839: Add rel="noopener" to output of wp_list_bookmarks() when target is set to "_blank"

WordPress Trac noreply at wordpress.org
Mon Aug 2 11:25:06 UTC 2021


#53839: Add rel="noopener" to output of wp_list_bookmarks() when target is set to
"_blank"
-------------------------+---------------------
 Reporter:  tw2113       |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  5.9
Component:  General      |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+---------------------

Comment (by SergeyBiryukov):

 Thanks for the patches!

 I think [attachment:"53839.patch"] would be preferable here, as it adds
 `noopener` to any link with a `target` attribute, rather than `_blank`
 specifically, which seems more consistent with `wp_targeted_link_rel()`.

 Some unit tests for this would be great. They could draw inspiration from
 the [source:tags/5.8/tests/phpunit/tests/formatting/WPTargetedLinkRel.php
 wp_targeted_link_rel() tests]. They could be for either
 `_walk_bookmarks()` or `wp_list_bookmarks()` function, and be placed under
 `tests/bookmarks/`.

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


More information about the wp-trac mailing list