Ensure expiration-related modal is shown to the installed subscriptions (#49747)
Ensure expiration-related modal is shown to the installed subscriptions
This commit is contained in:
parent
078aa72d50
commit
d5dcf91ee2
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: update
|
||||||
|
|
||||||
|
Ensure expiration-related modal is shown to the installed Woo subscriptions
|
|
@ -1336,7 +1336,11 @@ class WC_Helper {
|
||||||
* @return array Array of state_name => (bool) state
|
* @return array Array of state_name => (bool) state
|
||||||
*/
|
*/
|
||||||
public static function get_product_subscription_state( $product_id ) {
|
public static function get_product_subscription_state( $product_id ) {
|
||||||
$subscription = self::_get_subscriptions_from_product_id( $product_id, true );
|
$product_subscriptions = wp_list_filter( self::get_installed_subscriptions(), array( 'product_id' => $product_id ) );
|
||||||
|
|
||||||
|
$subscription = ! empty( $product_subscriptions )
|
||||||
|
? array_shift( $product_subscriptions )
|
||||||
|
: array();
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'unregistered' => empty( $subscription ),
|
'unregistered' => empty( $subscription ),
|
||||||
|
|
Loading…
Reference in New Issue