WC_HTTPS::force_https_page_link( string $link, int $page_id )

Force a post link to be SSL if needed.


Description Description


Parameters Parameters

$link

(Required)

$page_id

(Required)


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/class-wc-https.php

	public static function force_https_page_link( $link, $page_id ) {
		if ( in_array( $page_id, array( get_option( 'woocommerce_checkout_page_id' ), get_option( 'woocommerce_myaccount_page_id' ) ) ) ) {
			$link = str_replace( 'http:', 'https:', $link );
		} elseif ( 'yes' === get_option( 'woocommerce_unforce_ssl_checkout' ) && ! wc_site_is_https() ) {
			$link = str_replace( 'https:', 'http:', $link );
		}
		return $link;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.