PluginProbe
Subscriptions for WooCommerce with Stripe Recurring Payments / 2.3.0
Subscriptions for WooCommerce with Stripe Recurring Payments v2.3.0
2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.11.2 1.11.1 1.11.0 1.10.9 1.10.8 1.10.7 1.10.6 1.10.5 1.10.4 1.10.3 1.10.2 1.10.1 1.10.0 1.9.6 1.9.5 trunk 1.3.0 1.3.1 1.3.2 1.4.0 All 65 releases
← All changes | includes/functions.php +6 -8 2.4.0 → 2.3.0 View file →
@@ -10,10 +10,8 @@
10 10 exit;
11 11 }
12 12
13 13 use Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController;
14 -use SpringDevs\Subscription\Illuminate\Multilingual;
15 -use SpringDevs\Subscription\Illuminate\Plans\PlanRepository;
16 14 use SpringDevs\Subscription\Illuminate\Subscription\Subscription;
17 15 use SpringDevs\Subscription\Utils\Product;
18 16
19 17 /**
@@ -101,9 +99,9 @@
101 99 * @return bool
102 100 */
103 101 function subscrpt_product_has_plan( $product_id, $variation_id = 0 ): bool {
104 102 return ! empty(
105 - PlanRepository::resolve_for_product( $product_id, $variation_id )
103 + \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::resolve_for_product( $product_id, $variation_id )
106 104 );
107 105 }
108 106
109 107 /**
@@ -556,24 +554,24 @@
556 554 * @return string Plan label, or '' when the subscription has no plan.
557 555 */
558 556 function subscrpt_get_subscription_plan_label( $subscription_id ) {
559 557 $plan_id = (int) get_post_meta( $subscription_id, '_subscrpt_plan_id', true );
560 - if ( ! $plan_id || ! class_exists( PlanRepository::class ) ) {
558 + if ( ! $plan_id || ! class_exists( '\SpringDevs\Subscription\Illuminate\Plans\PlanRepository' ) ) {
561 559 return '';
562 560 }
563 561
564 - $plan = PlanRepository::get_plan( $plan_id );
562 + $plan = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_plan( $plan_id );
565 563 if ( ! $plan ) {
566 564 return '';
567 565 }
568 566
569 - $term_title = isset( $plan['title'] ) ? trim( Multilingual::translate_string( $plan['title'], Multilingual::plan_string_name( $plan_id ) ) ) : '';
567 + $term_title = isset( $plan['title'] ) ? trim( (string) $plan['title'] ) : '';
570 568 $group_title = '';
571 569 $group_id = (int) ( $plan['plan_group_id'] ?? 0 );
572 570 if ( $group_id ) {
573 - $group = PlanRepository::get_group( $group_id );
571 + $group = \SpringDevs\Subscription\Illuminate\Plans\PlanRepository::get_group( $group_id );
574 572 if ( $group && isset( $group['title'] ) ) {
575 - $group_title = trim( Multilingual::translate_string( $group['title'], Multilingual::group_string_name( $group_id ) ) );
573 + $group_title = trim( (string) $group['title'] );
576 574 }
577 575 }
578 576
579 577 $parts = array_filter( array( $group_title, $term_title ) );