[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
Thu Dec 16 15:42:15 UTC 2021

#53839: Add rel="noopener" to output of wp_list_bookmarks() when target is set to
 Reporter:  tw2113                           |       Owner:  hellofromTonya
     Type:  enhancement                      |      Status:  reopened
 Priority:  normal                           |   Milestone:  5.9
Component:  General                          |     Version:
 Severity:  normal                           |  Resolution:
 Keywords:  has-patch has-unit-tests commit  |     Focuses:
Changes (by david.binda):

 * status:  closed => reopened
 * resolution:  fixed =>


 Sorry for re-opening the ticket, but I have found out that the PHPUnit
 tests accompanying the functional changeset are not testing all the
 details of the change, as there is a typo in the argument passed to the
 `WP_UnitTestCase::factory()->bookmark->create` method.

 The code in `wp_list_bookmarks` works with the `link_rel` attribute (see
 template.php?rev=52061#L104), instead of the `rel` defined in the data
 providers (eg.:

 Therefore, the conditional in
 template.php?rev=52061#L108 is never matched by the PHPUnit tests, and
 none of the tests are actually passing in any previously existing `rel`
 attribute value; the `noopener`, if expected, is the only value in

 That said, I'm attaching a patch which fixes the typo in existing data
 providers, and adds one more test, which tests whether the noopener is
 actually added to the pre-existing value.

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

More information about the wp-trac mailing list