woocommerce_unforce_ssl_checkout

woocommerce_unforce_ssl_checkout

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

apply_filters('woocommerce_unforce_ssl_checkout') is found 1 times:

  • /includes/class-wc-https.php line 109
    		if ( function_exists( 'is_customize_preview' ) && is_customize_preview() ) {
    			return;
    		}
    
    		if ( ! wc_site_is_https() && is_ssl() && $_SERVER['REQUEST_URI'] && ! is_checkout() && ! wp_doing_ajax() && ! is_account_page() && apply_filters( 'woocommerce_unforce_ssl_checkout', true ) ) {
    
    			if ( 0 === strpos( $_SERVER['REQUEST_URI'], 'http' ) ) {
    				wp_safe_redirect( preg_replace( '|^https://|', 'http://', $_SERVER['REQUEST_URI'] ) );
    				exit;
    			} else {
    				wp_safe_redirect( 'http://' . ( ! empty( $_SERVER['HTTP_X_FORWARDED_HOST'] ) ? $_SERVER['HTTP_X_FORWARDED_HOST'] : $_SERVER['HTTP_HOST'] ) . $_SERVER['REQUEST_URI'] );
    

See this hook used in plugins: