WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 3 years ago

Last modified 3 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:
PR Number:

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

Download all attachments as: .zip

Change History (5)

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

ooo, this is better idea :)

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