Skip to content

Commit 2af76ed

Browse files
committed
General: Remove noopener from links opening in a new tab in wp_list_bookmarks().
This changeset removes the automatic addition of `rel="noopener"` from links targeting a new tab via `target="_blank"` in the `wp_list_bookmarks()` function. Since this was introduced, supported browsers have changed their security policies and no longer allow the opened link to have JavaScript access to the previous tab. This also removes the unit test cases previously located in `wpListBookmarks.php` as they were dedicated to test the presence of `rel="noopener"`. Follow-up to [52061], [59120]. Props audrasjb, rvouill, marineevain, jeremy80. Fixes #63096. git-svn-id: https://develop.svn.wordpress.org/trunk@60058 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 44465fd commit 2af76ed

File tree

2 files changed

+0
-116
lines changed

2 files changed

+0
-116
lines changed

src/wp-includes/bookmark-template.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,6 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
105105

106106
$target = $bookmark->link_target;
107107
if ( '' !== $target ) {
108-
if ( is_string( $rel ) && '' !== $rel ) {
109-
if ( ! str_contains( $rel, 'noopener' ) ) {
110-
$rel = trim( $rel ) . ' noopener';
111-
}
112-
} else {
113-
$rel = 'noopener';
114-
}
115-
116108
$target = ' target="' . $target . '"';
117109
}
118110

tests/phpunit/tests/bookmark/wpListBookmarks.php

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)