Make WordPress Core

Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#35691 closed enhancement (wontfix)

New function: `wp_get_protocol`

Reported by: sebastianpisula's profile 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 8 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dd32
8 years ago

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

#2 @sebastian.pisula
8 years ago

ooo, this is better idea :)

#3 @swissspidy
7 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
7 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.