WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 18 months ago

Last modified 18 months ago

#16945 closed enhancement (duplicate)

Add relative URIs containing a query in esc_url()

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Formatting Keywords: has-patch
Focuses: Cc:

Description

I'd like to enhance the esc_url function to accept an url starting with ? (query) to not require a protocol.

That's comparable with the # (fragment) case we already have in.

This is useful to create links to the current page that need a query only. Otherwise the php file must be added and for frontend pages it won't work with pretty permalinks.

Attachments (1)

16945.patch (874 bytes) - added by hakre 4 years ago.
First approach

Download all attachments as: .zip

Change History (7)

@hakre4 years ago

First approach

comment:1 @hakre4 years ago

Related: (In [11126]) Don't prepend http to fragments. Props scohoust. fixes #4051

comment:2 follow-up: @c3mdigital19 months ago

  • Keywords close 2nd-opinion added

comment:3 @SergeyBiryukov19 months ago

  • Component changed from General to Formatting

comment:4 in reply to: ↑ 2 @hakre18 months ago

Replying to c3mdigital:

Can you please justify your close suggestion?

comment:5 @nacin18 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

This actually changed some time ago.

comment:6 @SergeyBiryukov18 months ago

  • Keywords close 2nd-opinion removed
  • Milestone Awaiting Review deleted
  • Resolution changed from worksforme to duplicate

Duplicate of #18260.

Note: See TracTickets for help on using tickets.