wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_is_using_https › WordPress Function
Since5.7.0
Deprecatedn/a
› wp_is_using_https ( No parameters )
Returns: |
|
Defined at: |
|
Codex: |
Checks whether the website is using HTTPS.
This is based on whether the home and site URL are using HTTPS.Related Functions: wp_using_themes, wp_get_http, wp_get_single_post, wp_set_link_cats, wp_is_owned_html_output
Source
function wp_is_using_https() { if ( 'https' !== wp_parse_url( home_url(), PHP_URL_SCHEME ) ) { return false; } // Use direct option access for 'siteurl' and manually run the 'site_url' // filter because site_url() will adjust the scheme based on what the // current request is using. /** This filter is documented in wp-includes/link-template.php */ $site_url = apply_filters( 'site_url', get_option( 'siteurl' ), '', null, null ); if ( 'https' !== wp_parse_url( $site_url, PHP_URL_SCHEME ) ) { return false; } return true; }