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. Built from https://develop.svn.wordpress.org/trunk@60058 git-svn-id: http://core.svn.wordpress.org/trunk@59394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -105,14 +105,6 @@ function _walk_bookmarks( $bookmarks, $args = '' ) {
|
||||
|
||||
$target = $bookmark->link_target;
|
||||
if ( '' !== $target ) {
|
||||
if ( is_string( $rel ) && '' !== $rel ) {
|
||||
if ( ! str_contains( $rel, 'noopener' ) ) {
|
||||
$rel = trim( $rel ) . ' noopener';
|
||||
}
|
||||
} else {
|
||||
$rel = 'noopener';
|
||||
}
|
||||
|
||||
$target = ' target="' . $target . '"';
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-beta3-60057';
|
||||
$wp_version = '6.8-beta3-60058';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
||||
Reference in New Issue
Block a user