[wp-trac] [WordPress Trac] #52886: Update esc_url to allow for specifying an https:// as default protocol
WordPress Trac
noreply at wordpress.org
Wed Apr 28 22:02:55 UTC 2021
#52886: Update esc_url to allow for specifying an https:// as default protocol
-------------------------------------------------+-------------------------
Reporter: mkaz | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: 5.8
Component: Formatting | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-unit-tests needs- | Focuses:
dev-note |
-------------------------------------------------+-------------------------
Comment (by SergeyBiryukov):
> The usage could then be:
{{{
esc_url( $url, null, 'display', 'https://' );
}}}
Looking at this again, I wonder if it's straightforward enough in
practice, as it would require passing four parameters to every `esc_url()`
call that might be missing the protocol and should default to `https://`.
If the site is known to use `https://`, that seems redundant.
Perhaps this should be a filter instead, like `esc_url_default_protocol`?
That way it could only be specified once.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/52886#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list