Make WordPress Core


Ignore:
Timestamp:
07/01/2022 07:59:38 PM (2 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php

    r50995 r53630  
    172172            }
    173173
    174             /* translators: %s: URL to create a new menu. */
    175             printf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) );
     174            printf(
     175                /* translators: %s: URL to create a new menu. */
     176                __( 'No menus have been created yet. <a href="%s">Create some</a>.' ),
     177                // The URL can be a `javascript:` link, so esc_attr() is used here instead of esc_url().
     178                esc_attr( $url )
     179            );
    176180            ?>
    177181        </p>
Note: See TracChangeset for help on using the changeset viewer.