Make WordPress Core

Opened 9 years ago

Closed 8 years ago

Last modified 8 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:

Description

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 9 years ago.

Download all attachments as: .zip

Change History (5)

#1 @dd32
9 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
9 years ago

ooo, this is better idea :)

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