Wrap private link exclusion logic in `woocommerce_private_link` option check (#47690)
This commit is contained in:
parent
f55e25b009
commit
ee6f69a14e
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Wrap LYS private link exclusion logic in an overall check
|
|
@ -102,6 +102,8 @@ class ComingSoonRequestHandler {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the private link option is enabled.
|
||||||
|
if ( get_option( 'woocommerce_private_link' ) === 'yes' ) {
|
||||||
// Exclude users with a private link.
|
// Exclude users with a private link.
|
||||||
if ( isset( $_GET['woo-share'] ) && get_option( 'woocommerce_share_key' ) === $_GET['woo-share'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
if ( isset( $_GET['woo-share'] ) && get_option( 'woocommerce_share_key' ) === $_GET['woo-share'] ) { //phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||||
// Persist the share link with a cookie for 90 days.
|
// Persist the share link with a cookie for 90 days.
|
||||||
|
@ -111,6 +113,7 @@ class ComingSoonRequestHandler {
|
||||||
if ( isset( $_COOKIE['woo-share'] ) && get_option( 'woocommerce_share_key' ) === $_COOKIE['woo-share'] ) {
|
if ( isset( $_COOKIE['woo-share'] ) && get_option( 'woocommerce_share_key' ) === $_COOKIE['woo-share'] ) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue