Make WordPress Core

Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#35691 closed enhancement (wontfix)

New function: `wp_get_protocol`

Reported by: sebastian.pisula Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


In many locations I can see this condition: ( is_ssl() ? 'https://' : 'http://' ). Code duplication is bad.

Attachments (1)

35691.patch (5.7 KB) - added by sebastian.pisula 6 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dd32
6 years ago

We also have set_url_scheme( 'http://example.com/' ) at our disposal too, which is probably preferential to this proposal.

#2 @sebastian.pisula
6 years ago

ooo, this is better idea :)

#3 @swissspidy
5 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Closing as wontfix as we all seem to agree set_url_scheme() is to be prefered here.

#4 @SergeyBiryukov
5 years ago

Feel free to create a new ticket if there are still any is_ssl() checks in core that should be replaced with set_url_scheme().

Note: See TracTickets for help on using tickets.