Widgets: Add a comment in `WP_Nav_Menu_Widget::form()` to clarify the `esc_attr()` usage.
The URL to create a new menu from the the Navigation Menu widget can be a `javascript:` link to the Customizer Menus panel, so `esc_attr()` is used here instead of `esc_url()`. Follow-up to [53092]. Props hztyfoon. Fixes #56128. Built from https://develop.svn.wordpress.org/trunk@53630 git-svn-id: http://core.svn.wordpress.org/trunk@53189 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c3188a2566
commit
1f87125366
|
@ -16,7 +16,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.1-alpha-53629';
|
$wp_version = '6.1-alpha-53630';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
|
|
@ -171,8 +171,12 @@ class WP_Nav_Menu_Widget extends WP_Widget {
|
||||||
$url = admin_url( 'nav-menus.php' );
|
$url = admin_url( 'nav-menus.php' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/* translators: %s: URL to create a new menu. */
|
printf(
|
||||||
printf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) );
|
/* translators: %s: URL to create a new menu. */
|
||||||
|
__( 'No menus have been created yet. <a href="%s">Create some</a>.' ),
|
||||||
|
// The URL can be a `javascript:` link, so esc_attr() is used here instead of esc_url().
|
||||||
|
esc_attr( $url )
|
||||||
|
);
|
||||||
?>
|
?>
|
||||||
</p>
|
</p>
|
||||||
<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
|
<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
|
||||||
|
|
Loading…
Reference in New Issue