General: Remove `noopener` from links opening in a new tab.
Removes the automatic addition of `rel="noopener noreferrer"` from links targeting a new tab or window, `target='_blank'`. 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. Deprecates: * `wp_targeted_link_rel()` * `wp_targeted_link_rel_callback()` * `wp_init_targeted_link_rel_filters()`: converted to a noop function * `wp_remove_targeted_link_rel_filters()`: converted to a noop function The deprecated functions are retained in `formatting.php` as in `SHORTINIT` mode the file is included while `deprecated.php` is not. This also removes the `noopener` from links hard coded within the WordPress dashboard linking to documentation and other resources. Props audrasjb, azaozz, dhruval04, dorzki, neo2k23, presskopp, sabernhardt, swissspidy, tobiasbg. Fixes #53843. Built from https://develop.svn.wordpress.org/trunk@59120 git-svn-id: http://core.svn.wordpress.org/trunk@58516 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cf877c686b
commit
8c3dd2eb88
|
@ -746,7 +746,7 @@ class WP_Site_Health {
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
esc_url( wp_get_update_php_url() ),
|
esc_url( wp_get_update_php_url() ),
|
||||||
__( 'Learn more about updating PHP' ),
|
__( 'Learn more about updating PHP' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -892,7 +892,7 @@ class WP_Site_Health {
|
||||||
__( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in <a href="%1$s" %2$s>the team handbook%3$s</a>.' ),
|
__( 'The WordPress Hosting Team maintains a list of those modules, both recommended and required, in <a href="%1$s" %2$s>the team handbook%3$s</a>.' ),
|
||||||
/* translators: Localized team handbook, if one exists. */
|
/* translators: Localized team handbook, if one exists. */
|
||||||
esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),
|
esc_url( __( 'https://make.wordpress.org/hosting/handbook/handbook/server-environment/#php-extensions' ) ),
|
||||||
'target="_blank" rel="noopener"',
|
'target="_blank"',
|
||||||
sprintf(
|
sprintf(
|
||||||
'<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
|
'<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -1218,7 +1218,7 @@ class WP_Site_Health {
|
||||||
__( 'The SQL server is a required piece of software for the database WordPress uses to store all your site’s content and settings.' )
|
__( 'The SQL server is a required piece of software for the database WordPress uses to store all your site’s content and settings.' )
|
||||||
),
|
),
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
/* translators: Localized version of WordPress requirements if one exists. */
|
/* translators: Localized version of WordPress requirements if one exists. */
|
||||||
esc_url( __( 'https://wordpress.org/about/requirements/' ) ),
|
esc_url( __( 'https://wordpress.org/about/requirements/' ) ),
|
||||||
__( 'Learn more about what WordPress requires to run.' ),
|
__( 'Learn more about what WordPress requires to run.' ),
|
||||||
|
@ -1335,7 +1335,7 @@ class WP_Site_Health {
|
||||||
);
|
);
|
||||||
|
|
||||||
$result['actions'] = sprintf(
|
$result['actions'] = sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
/* translators: Localized Support reference. */
|
/* translators: Localized Support reference. */
|
||||||
esc_url( __( 'https://wordpress.org/support/forums/' ) ),
|
esc_url( __( 'https://wordpress.org/support/forums/' ) ),
|
||||||
__( 'Get help resolving this issue.' ),
|
__( 'Get help resolving this issue.' ),
|
||||||
|
@ -1373,7 +1373,7 @@ class WP_Site_Health {
|
||||||
__( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' )
|
__( 'Debug mode is often enabled to gather more details about an error or site failure, but may contain sensitive information which should not be available on a publicly available website.' )
|
||||||
),
|
),
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
/* translators: Documentation explaining debugging in WordPress. */
|
/* translators: Documentation explaining debugging in WordPress. */
|
||||||
esc_url( __( 'https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/' ) ),
|
esc_url( __( 'https://developer.wordpress.org/advanced-administration/debug/debug-wordpress/' ) ),
|
||||||
__( 'Learn more about debugging in WordPress.' ),
|
__( 'Learn more about debugging in WordPress.' ),
|
||||||
|
@ -1455,7 +1455,7 @@ class WP_Site_Health {
|
||||||
__( 'An HTTPS connection is a more secure way of browsing the web. Many services now have HTTPS as a requirement. HTTPS allows you to take advantage of new features that can increase site speed, improve search rankings, and gain the trust of your visitors by helping to protect their online privacy.' )
|
__( 'An HTTPS connection is a more secure way of browsing the web. Many services now have HTTPS as a requirement. HTTPS allows you to take advantage of new features that can increase site speed, improve search rankings, and gain the trust of your visitors by helping to protect their online privacy.' )
|
||||||
),
|
),
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
esc_url( $default_update_url ),
|
esc_url( $default_update_url ),
|
||||||
__( 'Learn more about why you should use HTTPS' ),
|
__( 'Learn more about why you should use HTTPS' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -1539,7 +1539,7 @@ class WP_Site_Health {
|
||||||
|
|
||||||
if ( ! empty( $direct_update_url ) ) {
|
if ( ! empty( $direct_update_url ) ) {
|
||||||
$result['actions'] = sprintf(
|
$result['actions'] = sprintf(
|
||||||
'<p class="button-container"><a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p class="button-container"><a class="button button-primary" href="%1$s" target="_blank">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
esc_url( $direct_update_url ),
|
esc_url( $direct_update_url ),
|
||||||
__( 'Update your site to use HTTPS' ),
|
__( 'Update your site to use HTTPS' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -1558,7 +1558,7 @@ class WP_Site_Health {
|
||||||
$update_url = wp_get_update_https_url();
|
$update_url = wp_get_update_https_url();
|
||||||
if ( $update_url !== $default_update_url ) {
|
if ( $update_url !== $default_update_url ) {
|
||||||
$result['description'] .= sprintf(
|
$result['description'] .= sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
esc_url( $update_url ),
|
esc_url( $update_url ),
|
||||||
__( 'Talk to your web host about supporting HTTPS for your website.' ),
|
__( 'Talk to your web host about supporting HTTPS for your website.' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -2364,7 +2364,7 @@ class WP_Site_Health {
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
$result['actions'] .= sprintf(
|
$result['actions'] .= sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
__( 'https://developer.wordpress.org/rest-api/frequently-asked-questions/#why-is-authentication-not-working' ),
|
__( 'https://developer.wordpress.org/rest-api/frequently-asked-questions/#why-is-authentication-not-working' ),
|
||||||
__( 'Learn how to configure the Authorization header.' ),
|
__( 'Learn how to configure the Authorization header.' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -2397,7 +2397,7 @@ class WP_Site_Health {
|
||||||
'status' => 'good',
|
'status' => 'good',
|
||||||
'label' => '',
|
'label' => '',
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%1$s" target="_blank" rel="noopener noreferrer">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%1$s" target="_blank" rel="noreferrer">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
__( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#caching' ),
|
__( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#caching' ),
|
||||||
__( 'Learn more about page cache' ),
|
__( 'Learn more about page cache' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -2523,7 +2523,7 @@ class WP_Site_Health {
|
||||||
__( 'A persistent object cache makes your site’s database more efficient, resulting in faster load times because WordPress can retrieve your site’s content and settings much more quickly.' )
|
__( 'A persistent object cache makes your site’s database more efficient, resulting in faster load times because WordPress can retrieve your site’s content and settings much more quickly.' )
|
||||||
),
|
),
|
||||||
'actions' => sprintf(
|
'actions' => sprintf(
|
||||||
'<p><a href="%s" target="_blank" rel="noopener">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
'<p><a href="%s" target="_blank">%s<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
|
||||||
esc_url( $action_url ),
|
esc_url( $action_url ),
|
||||||
__( 'Learn more about persistent object caching.' ),
|
__( 'Learn more about persistent object caching.' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
@ -2671,7 +2671,7 @@ class WP_Site_Health {
|
||||||
|
|
||||||
$result['actions'] = sprintf(
|
$result['actions'] = sprintf(
|
||||||
/* translators: 1: HelpHub URL, 2: Link description. */
|
/* translators: 1: HelpHub URL, 2: Link description. */
|
||||||
'<p><a target="_blank" rel="noopener" href="%1$s">%2$s</a></p>',
|
'<p><a target="_blank" href="%1$s">%2$s</a></p>',
|
||||||
esc_url( __( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#autoloaded-options' ) ),
|
esc_url( __( 'https://developer.wordpress.org/advanced-administration/performance/optimization/#autoloaded-options' ) ),
|
||||||
__( 'More info about optimizing autoloaded options' )
|
__( 'More info about optimizing autoloaded options' )
|
||||||
);
|
);
|
||||||
|
|
|
@ -1912,7 +1912,7 @@ function wp_dashboard_php_nag() {
|
||||||
<p class="button-container">
|
<p class="button-container">
|
||||||
<?php
|
<?php
|
||||||
printf(
|
printf(
|
||||||
'<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
|
'<a class="button button-primary" href="%1$s" target="_blank">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
|
||||||
esc_url( wp_get_update_php_url() ),
|
esc_url( wp_get_update_php_url() ),
|
||||||
__( 'Learn more about updating PHP' ),
|
__( 'Learn more about updating PHP' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
|
|
@ -3243,7 +3243,7 @@ function edit_form_image_editor( $post ) {
|
||||||
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
|
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
|
||||||
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
|
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
|
||||||
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
|
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
|
||||||
'target="_blank" rel="noopener"',
|
'target="_blank"',
|
||||||
sprintf(
|
sprintf(
|
||||||
'<span class="screen-reader-text"> %s</span>',
|
'<span class="screen-reader-text"> %s</span>',
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
|
|
@ -215,11 +215,7 @@ class Walker_Nav_Menu extends Walker {
|
||||||
$atts = array();
|
$atts = array();
|
||||||
$atts['title'] = ! empty( $menu_item->attr_title ) ? $menu_item->attr_title : '';
|
$atts['title'] = ! empty( $menu_item->attr_title ) ? $menu_item->attr_title : '';
|
||||||
$atts['target'] = ! empty( $menu_item->target ) ? $menu_item->target : '';
|
$atts['target'] = ! empty( $menu_item->target ) ? $menu_item->target : '';
|
||||||
if ( '_blank' === $menu_item->target && empty( $menu_item->xfn ) ) {
|
$atts['rel'] = ! empty( $menu_item->xfn ) ? $menu_item->xfn : '';
|
||||||
$atts['rel'] = 'noopener';
|
|
||||||
} else {
|
|
||||||
$atts['rel'] = $menu_item->xfn;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! empty( $menu_item->url ) ) {
|
if ( ! empty( $menu_item->url ) ) {
|
||||||
if ( get_privacy_policy_url() === $menu_item->url ) {
|
if ( get_privacy_policy_url() === $menu_item->url ) {
|
||||||
|
|
|
@ -3766,7 +3766,7 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
|
||||||
case 'comment_link':
|
case 'comment_link':
|
||||||
$value = get_comment_link( $comment->comment_ID );
|
$value = get_comment_link( $comment->comment_ID );
|
||||||
$value = sprintf(
|
$value = sprintf(
|
||||||
'<a href="%s" target="_blank" rel="noopener">%s</a>',
|
'<a href="%s" target="_blank">%s</a>',
|
||||||
esc_url( $value ),
|
esc_url( $value ),
|
||||||
esc_html( $value )
|
esc_html( $value )
|
||||||
);
|
);
|
||||||
|
|
|
@ -153,9 +153,6 @@ foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pr
|
||||||
add_filter( $filter, 'balanceTags', 50 );
|
add_filter( $filter, 'balanceTags', 50 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add proper rel values for links with target.
|
|
||||||
add_action( 'init', 'wp_init_targeted_link_rel_filters' );
|
|
||||||
|
|
||||||
// Format strings for display.
|
// Format strings for display.
|
||||||
foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'document_title', 'widget_title' ) as $filter ) {
|
foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'document_title', 'widget_title' ) as $filter ) {
|
||||||
add_filter( $filter, 'wptexturize' );
|
add_filter( $filter, 'wptexturize' );
|
||||||
|
|
|
@ -3294,11 +3294,14 @@ function wp_rel_ugc( $text ) {
|
||||||
*
|
*
|
||||||
* @since 5.1.0
|
* @since 5.1.0
|
||||||
* @since 5.6.0 Removed 'noreferrer' relationship.
|
* @since 5.6.0 Removed 'noreferrer' relationship.
|
||||||
|
* @deprecated 6.7.0
|
||||||
*
|
*
|
||||||
* @param string $text Content that may contain HTML A elements.
|
* @param string $text Content that may contain HTML A elements.
|
||||||
* @return string Converted content.
|
* @return string Converted content.
|
||||||
*/
|
*/
|
||||||
function wp_targeted_link_rel( $text ) {
|
function wp_targeted_link_rel( $text ) {
|
||||||
|
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||||
|
|
||||||
// Don't run (more expensive) regex if no links with targets.
|
// Don't run (more expensive) regex if no links with targets.
|
||||||
if ( stripos( $text, 'target' ) === false || stripos( $text, '<a ' ) === false || is_serialized( $text ) ) {
|
if ( stripos( $text, 'target' ) === false || stripos( $text, '<a ' ) === false || is_serialized( $text ) ) {
|
||||||
return $text;
|
return $text;
|
||||||
|
@ -3332,11 +3335,14 @@ function wp_targeted_link_rel( $text ) {
|
||||||
*
|
*
|
||||||
* @since 5.1.0
|
* @since 5.1.0
|
||||||
* @since 5.6.0 Removed 'noreferrer' relationship.
|
* @since 5.6.0 Removed 'noreferrer' relationship.
|
||||||
|
* @deprecated 6.7.0
|
||||||
*
|
*
|
||||||
* @param array $matches Single match.
|
* @param array $matches Single match.
|
||||||
* @return string HTML A Element with `rel="noopener"` in addition to any existing values.
|
* @return string HTML A Element with `rel="noopener"` in addition to any existing values.
|
||||||
*/
|
*/
|
||||||
function wp_targeted_link_rel_callback( $matches ) {
|
function wp_targeted_link_rel_callback( $matches ) {
|
||||||
|
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||||
|
|
||||||
$link_html = $matches[1];
|
$link_html = $matches[1];
|
||||||
$original_link_html = $link_html;
|
$original_link_html = $link_html;
|
||||||
|
|
||||||
|
@ -3383,46 +3389,20 @@ function wp_targeted_link_rel_callback( $matches ) {
|
||||||
* Adds all filters modifying the rel attribute of targeted links.
|
* Adds all filters modifying the rel attribute of targeted links.
|
||||||
*
|
*
|
||||||
* @since 5.1.0
|
* @since 5.1.0
|
||||||
|
* @deprecated 6.7.0
|
||||||
*/
|
*/
|
||||||
function wp_init_targeted_link_rel_filters() {
|
function wp_init_targeted_link_rel_filters() {
|
||||||
$filters = array(
|
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||||
'title_save_pre',
|
|
||||||
'content_save_pre',
|
|
||||||
'excerpt_save_pre',
|
|
||||||
'content_filtered_save_pre',
|
|
||||||
'pre_comment_content',
|
|
||||||
'pre_term_description',
|
|
||||||
'pre_link_description',
|
|
||||||
'pre_link_notes',
|
|
||||||
'pre_user_description',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ( $filters as $filter ) {
|
|
||||||
add_filter( $filter, 'wp_targeted_link_rel' );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes all filters modifying the rel attribute of targeted links.
|
* Removes all filters modifying the rel attribute of targeted links.
|
||||||
*
|
*
|
||||||
* @since 5.1.0
|
* @since 5.1.0
|
||||||
|
* @deprecated 6.7.0
|
||||||
*/
|
*/
|
||||||
function wp_remove_targeted_link_rel_filters() {
|
function wp_remove_targeted_link_rel_filters() {
|
||||||
$filters = array(
|
_deprecated_function( __FUNCTION__, '6.7.0' );
|
||||||
'title_save_pre',
|
|
||||||
'content_save_pre',
|
|
||||||
'excerpt_save_pre',
|
|
||||||
'content_filtered_save_pre',
|
|
||||||
'pre_comment_content',
|
|
||||||
'pre_term_description',
|
|
||||||
'pre_link_description',
|
|
||||||
'pre_link_notes',
|
|
||||||
'pre_user_description',
|
|
||||||
);
|
|
||||||
|
|
||||||
foreach ( $filters as $filter ) {
|
|
||||||
remove_filter( $filter, 'wp_targeted_link_rel' );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -8517,7 +8517,7 @@ function wp_direct_php_update_button() {
|
||||||
|
|
||||||
echo '<p class="button-container">';
|
echo '<p class="button-container">';
|
||||||
printf(
|
printf(
|
||||||
'<a class="button button-primary" href="%1$s" target="_blank" rel="noopener">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
|
'<a class="button button-primary" href="%1$s" target="_blank">%2$s<span class="screen-reader-text"> %3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a>',
|
||||||
esc_url( $direct_update_url ),
|
esc_url( $direct_update_url ),
|
||||||
__( 'Update PHP' ),
|
__( 'Update PHP' ),
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
renderHtml: function() {
|
renderHtml: function() {
|
||||||
return (
|
return (
|
||||||
'<div id="' + this._id + '" class="wp-link-preview">' +
|
'<div id="' + this._id + '" class="wp-link-preview">' +
|
||||||
'<a href="' + this.url + '" target="_blank" rel="noopener" tabindex="-1">' + this.url + '</a>' +
|
'<a href="' + this.url + '" target="_blank" tabindex="-1">' + this.url + '</a>' +
|
||||||
'</div>'
|
'</div>'
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -323,7 +323,7 @@
|
||||||
var html = '<a href="' + attrs.href + '"';
|
var html = '<a href="' + attrs.href + '"';
|
||||||
|
|
||||||
if ( attrs.target ) {
|
if ( attrs.target ) {
|
||||||
html += ' rel="noopener" target="' + attrs.target + '"';
|
html += ' target="' + attrs.target + '"';
|
||||||
}
|
}
|
||||||
|
|
||||||
return html + '>';
|
return html + '>';
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -161,7 +161,7 @@ function wp_print_media_templates() {
|
||||||
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
|
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
|
||||||
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
|
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
|
||||||
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
|
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
|
||||||
'target="_blank" rel="noopener"',
|
'target="_blank"',
|
||||||
sprintf(
|
sprintf(
|
||||||
'<span class="screen-reader-text"> %s</span>',
|
'<span class="screen-reader-text"> %s</span>',
|
||||||
/* translators: Hidden accessibility text. */
|
/* translators: Hidden accessibility text. */
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.7-alpha-59119';
|
$wp_version = '6.7-alpha-59120';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
|
@ -149,9 +149,6 @@ class WP_Widget_Custom_HTML extends WP_Widget {
|
||||||
/** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
|
/** This filter is documented in wp-includes/widgets/class-wp-widget-text.php */
|
||||||
$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
|
$content = apply_filters( 'widget_text', $instance['content'], $simulated_text_widget_instance, $this );
|
||||||
|
|
||||||
// Adds 'noopener' relationship, without duplicating values, to all HTML A elements that have a target.
|
|
||||||
$content = wp_targeted_link_rel( $content );
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filters the content of the Custom HTML widget.
|
* Filters the content of the Custom HTML widget.
|
||||||
*
|
*
|
||||||
|
|
|
@ -288,7 +288,7 @@ class WP_Widget_Media_Image extends WP_Widget_Media {
|
||||||
$link .= '>';
|
$link .= '>';
|
||||||
$link .= $image;
|
$link .= $image;
|
||||||
$link .= '</a>';
|
$link .= '</a>';
|
||||||
$image = wp_targeted_link_rel( $link );
|
$image = $link;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $caption ) {
|
if ( $caption ) {
|
||||||
|
|
|
@ -334,9 +334,6 @@ class WP_Widget_Text extends WP_Widget {
|
||||||
|
|
||||||
$text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );
|
$text = preg_replace_callback( '#<(video|iframe|object|embed)\s[^>]*>#i', array( $this, 'inject_video_max_width_style' ), $text );
|
||||||
|
|
||||||
// Adds 'noopener' relationship, without duplicating values, to all HTML A elements that have a target.
|
|
||||||
$text = wp_targeted_link_rel( $text );
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<div class="textwidget"><?php echo $text; ?></div>
|
<div class="textwidget"><?php echo $text; ?></div>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -697,7 +697,7 @@ switch ( $action ) {
|
||||||
);
|
);
|
||||||
|
|
||||||
printf(
|
printf(
|
||||||
'<a href="%s" rel="noopener" target="_blank">%s%s</a>',
|
'<a href="%s" target="_blank">%s%s</a>',
|
||||||
esc_url( $admin_email_help_url ),
|
esc_url( $admin_email_help_url ),
|
||||||
__( 'Why is this important?' ),
|
__( 'Why is this important?' ),
|
||||||
$accessibility_text
|
$accessibility_text
|
||||||
|
@ -1629,7 +1629,6 @@ switch ( $action ) {
|
||||||
for ( i in links ) {
|
for ( i in links ) {
|
||||||
if ( links[i].href ) {
|
if ( links[i].href ) {
|
||||||
links[i].target = '_blank';
|
links[i].target = '_blank';
|
||||||
links[i].rel = 'noopener';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch( er ) {}
|
} catch( er ) {}
|
||||||
|
|
Loading…
Reference in New Issue