is_ssl example

$orig_scheme = $scheme;

    if ( empty( $blog_id ) || ! is_multisite() ) {
        $url = get_option( 'home' );
    } else {
        switch_to_blog( $blog_id );
        $url = get_option( 'home' );
        restore_current_blog();
    }

    if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) {
        if ( is_ssl() ) {
            $scheme = 'https';
        } else {
            $scheme = parse_url( $url, PHP_URL_SCHEME );
        }
    }

    $url = set_url_scheme( $url$scheme );

    if ( $path && is_string( $path ) ) {
        $url .= '/' . ltrim( $path, '/' );
    }

    

function filter_SSL( $url ) {  // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid     if ( ! is_string( $url ) ) {
        return get_bloginfo( 'url' ); // Return home site URL with proper scheme.     }

    if ( force_ssl_content() && is_ssl() ) {
        $url = set_url_scheme( $url, 'https' );
    }

    return $url;
}

/** * Schedules update of the network-wide counts for the current network. * * @since 3.1.0 */

    public function get_allowed_urls() {
        $allowed_urls = array( home_url( '/' ) );

        if ( is_ssl() && ! $this->is_cross_domain() ) {
            $allowed_urls[] = home_url( '/', 'https' );
        }

        /** * Filters the list of URLs allowed to be clicked and followed in the Customizer preview. * * @since 3.4.0 * * @param string[] $allowed_urls An array of allowed URLs. */
        $allowed_urls = array_unique( apply_filters( 'customize_allowed_urls', $allowed_urls ) );

        
                $path = preg_replace( '#/' . preg_quote( $directory, '#' ) . '/[^/]*$#i', '', $_SERVER['REQUEST_URI'] );
            } elseif ( str_contains( $abspath_fix$script_filename_dir ) ) {
                // Request is hitting a file above ABSPATH.                 $subdirectory = substr( $abspath_fixstrpos( $abspath_fix$script_filename_dir ) + strlen( $script_filename_dir ) );
                // Strip off any file/query params from the path, appending the subdirectory to the installation.                 $path = preg_replace( '#/[^/]*$#i', '', $_SERVER['REQUEST_URI'] ) . $subdirectory;
            } else {
                $path = $_SERVER['REQUEST_URI'];
            }
        }

        $schema = is_ssl() ? 'https://' : 'http://'; // set_url_scheme() is not defined yet.         $url    = $schema . $_SERVER['HTTP_HOST'] . $path;
    }

    return rtrim( $url, '/' );
}

/** * Temporarily suspends cache additions. * * Stops more data being added to the cache, but still allows cache retrieval. * This is useful for actions, such as imports, when a lot of data would otherwise * be almost uselessly added to the cache. * * Suspension lasts for a single page load at most. Remember to call this * function again if you wish to re-enable cache adds earlier. * * @since 3.3.0 * * @param bool $suspend Optional. Suspends additions if true, re-enables them if false. * Defaults to not changing the current setting. * @return bool The current suspend setting. */

    do_action_ref_array( 'wp_authenticate', array( &$credentials['user_login'], &$credentials['user_password'] ) );

    if ( '' === $secure_cookie ) {
        $secure_cookie = is_ssl();
    }

    /** * Filters whether to use a secure sign-on cookie. * * @since 3.1.0 * * @param bool $secure_cookie Whether to use a secure sign-on cookie. * @param array $credentials { * Array of entered sign-on data. * * @type string $user_login Username. * @type string $user_password Password entered. * @type bool $remember Whether to 'remember' the user. Increases the time * that the cookie will be kept. Default false. * } */
$wp_embed->return_false_on_fail = true;

    if ( 0 === $post_id ) {
        /* * Refresh oEmbeds cached outside of posts that are past their TTL. * Posts are excluded because they have separate logic for refreshing * their post meta caches. See WP_Embed::cache_oembed(). */
        $wp_embed->usecache = false;
    }

    if ( is_ssl() && str_starts_with( $url, 'http://' ) ) {
        /* * Admin is ssl and the user pasted non-ssl URL. * Check if the provider supports ssl embeds and use that for the preview. */
        $ssl_shortcode = preg_replace( '%^(\\[embed[^\\]]*\\])http://%i', '$1https://', $shortcode );
        $parsed        = $wp_embed->run_shortcode( $ssl_shortcode );

        if ( ! $parsed ) {
            $no_ssl_support = true;
        }
    }

    

function wp_login_form( $args = array() ) {
    $defaults = array(
        'echo'           => true,
        // Default 'redirect' value takes the user back to the request URI.         'redirect'       => ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'],
        'form_id'        => 'loginform',
        'label_username' => __( 'Username or Email Address' ),
        'label_password' => __( 'Password' ),
        'label_remember' => __( 'Remember Me' ),
        'label_log_in'   => __( 'Log In' ),
        'id_username'    => 'user_login',
        'id_password'    => 'user_pass',
        'id_remember'    => 'rememberme',
        'id_submit'      => 'wp-submit',
        'remember'       => true,
        'value_username' => '',
        

    protected function redirect_protected() {
        // Pluggable is usually loaded after plugins, so we manually include it here for redirection functionality.         if ( ! function_exists( 'wp_safe_redirect' ) ) {
            require_once ABSPATH . WPINC . '/pluggable.php';
        }

        $scheme = is_ssl() ? 'https://' : 'http://';

        $url = "{$scheme}{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
        wp_safe_redirect( $url );
        exit;
    }
}

        } else {
            $msg = sprintf(
                /* translators: %s: Browser name and link. */
                __( "It looks like you're using an old version of %s. For the best WordPress experience, please update your browser." ),
                sprintf( '<a href="%s">%s</a>', esc_url( $response['update_url'] )esc_html( $response['name'] ) )
            );
        }

        $browser_nag_class = '';
        if ( ! empty( $response['img_src'] ) ) {
            $img_src = ( is_ssl() && ! empty( $response['img_src_ssl'] ) ) ? $response['img_src_ssl'] : $response['img_src'];

            $notice           .= '<div class="alignright browser-icon"><img src="' . esc_url( $img_src ) . '" alt="" /></div>';
            $browser_nag_class = ' has-browser-icon';
        }
        $notice .= "<p class='browser-update-nag{$browser_nag_class}'>{$msg}</p>";

        $browsehappy = 'https://browsehappy.com/';
        $locale      = get_user_locale();
        if ( 'en_US' !== $locale ) {
            $browsehappy = add_query_arg( 'locale', $locale$browsehappy );
        }

        
/* * nginx only allows HTTP/1.0 methods when redirecting from / to /index.php. * To work around this, we manually add index.php to the URL, avoiding the redirect. */
        if ( ! str_ends_with( $url, 'index.php' ) ) {
            $url .= 'index.php';
        }

        $url = add_query_arg( 'rest_route', $path$url );
    }

    if ( is_ssl() && isset( $_SERVER['SERVER_NAME'] ) ) {
        // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS.         if ( parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) === $_SERVER['SERVER_NAME'] ) {
            $url = set_url_scheme( $url, 'https' );
        }
    }

    if ( is_admin() && force_ssl_admin() ) {
        /* * In this situation the home URL may be http:, and `is_ssl()` may be false, * but the admin is served over https: (one way or another), so REST API usage * will be blocked by browsers unless it is also served over HTTPS. */
// During activation of a new subdomain, the requested site does not yet exist.     if ( empty( $current_blog ) && wp_installing() ) {
        $current_blog          = new stdClass();
        $current_blog->blog_id = 1;
        $blog_id               = 1;
        $current_blog->public  = 1;
    }

    // No site has been found, bail.     if ( empty( $current_blog ) ) {
        // We're going to redirect to the network URL, with some possible modifications.         $scheme      = is_ssl() ? 'https' : 'http';
        $destination = "$scheme://{$current_site->domain}{$current_site->path}";

        /** * Fires when a network can be determined but a site cannot. * * At the time of this action, the only recourse is to redirect somewhere * and exit. If you want to declare a particular site, do so earlier. * * @since 3.9.0 * * @param WP_Network $current_site The network that had been determined. * @param string $domain The domain used to search for a site. * @param string $path The path used to search for a site. */

    }

    if ( is_admin() || is_search() || is_preview() || is_trackback() || is_favicon()
        || ( $is_IIS && ! iis7_supports_permalinks() )
    ) {
        return;
    }

    if ( ! $requested_url && isset( $_SERVER['HTTP_HOST'] ) ) {
        // Build the URL in the address bar.         $requested_url  = is_ssl() ? 'https://' : 'http://';
        $requested_url .= $_SERVER['HTTP_HOST'];
        $requested_url .= $_SERVER['REQUEST_URI'];
    }

    $original = parse_url( $requested_url );
    if ( false === $original ) {
        return;
    }

    $redirect     = $original;
    $redirect_url = false;
    
/** * Renders the `core/loginout` block on server. * * @param array $attributes The block attributes. * * @return string Returns the login-out link or form. */
function render_block_core_loginout( $attributes ) {

    // Build the redirect URL.     $current_url = ( is_ssl() ? 'https://' : 'http://' ) . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];

    $classes  = is_user_logged_in() ? 'logged-in' : 'logged-out';
    $contents = wp_loginout(
        isset( $attributes['redirectToCurrent'] ) && $attributes['redirectToCurrent'] ? $current_url : '',
        false
    );

    // If logged-out and displayLoginAsForm is true, show the login form.     if ( ! is_user_logged_in() && ! empty( $attributes['displayLoginAsForm'] ) ) {
        // Add a class.         $classes .= ' has-login-form';

        


    /* * If any of the above options failed, Fallback on the GUID as used pre-2.7, * not recommended to rely upon this. */
    if ( ! $url ) {
        $url = get_the_guid( $post->ID );
    }

    // On SSL front end, URLs should be HTTPS.     if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) {
        $url = set_url_scheme( $url );
    }

    /** * Filters the attachment URL. * * @since 2.1.0 * * @param string $url URL for the given attachment. * @param int $attachment_id Attachment post ID. */
    
wp_update_attachment_metadata( $post_id$newmeta );

        // Intentional fall-through to trigger the edit_post() call.     case 'editpost':
        check_admin_referer( 'update-post_' . $post_id );

        $post_id = edit_post();

        // Session cookie flag that the post was saved.         if ( isset( $_COOKIE['wp-saving-post'] ) && $_COOKIE['wp-saving-post'] === $post_id . '-check' ) {
            setcookie( 'wp-saving-post', $post_id . '-saved', time() + DAY_IN_SECONDS, ADMIN_COOKIE_PATH, COOKIE_DOMAIN, is_ssl() );
        }

        redirect_post( $post_id ); // Send user on their way while we keep working.
        exit;

    case 'trash':
        check_admin_referer( 'trash-post_' . $post_id );

        if ( ! $post ) {
            wp_die( __( 'The item you are trying to move to the Trash no longer exists.' ) );
        }
Home | Imprint | This part of the site doesn't use cookies.