Skip to content

Commit 448f5e9

Browse files
author
Kristófer Reykjalín
authored
Undeprecate the PRB location filters (#2323)
* Undeprecate the PRB location filters This commit undeprecates the following filters: * wc_stripe_show_payment_request_on_cart * wc_stripe_show_payment_request_on_checkout * wc_stripe_hide_payment_request_on_product_page The reason is to be found in #2099.
1 parent 1cff7dd commit 448f5e9

File tree

3 files changed

+10
-30
lines changed

3 files changed

+10
-30
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
= 6.3.0 - 2022-xx-xx =
44
* Tweak - Remove html from translatable strings
5+
* Tweak - Revert the deprecation of the 'wc_stripe_hide_payment_request_on_product_page', 'wc_stripe_show_payment_request_on_checkout', and 'wc_stripe_show_payment_request_on_cart' filters.
56

67
= 6.2.0 - 2022-02-17 =
78
* Add - Add onboarding payment gateway setup methods.

includes/payment-methods/class-wc-stripe-payment-request.php

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -922,19 +922,11 @@ public function should_show_payment_request_button() {
922922
* @return boolean True if PRBs are enabled on the cart page, false otherwise
923923
*/
924924
public function should_show_prb_on_cart_page() {
925-
// Message we show for the deprecated PRB location filters. Intended for support so we
926-
// don't provide translations.
927-
$deprecation_message =
928-
'Please configure Payment Request Button locations through the Stripe plugin settings.';
929925
$should_show_on_cart_page = in_array( 'cart', $this->get_button_locations(), true );
930926

931-
// Respect the deprecated filters, but add a deprecation notice.
932-
return apply_filters_deprecated(
927+
return apply_filters(
933928
'wc_stripe_show_payment_request_on_cart',
934-
[ $should_show_on_cart_page ],
935-
'5.5.0',
936-
'', // There is no replacement.
937-
$deprecation_message
929+
$should_show_on_cart_page
938930
);
939931
}
940932

@@ -949,19 +941,12 @@ public function should_show_prb_on_cart_page() {
949941
public function should_show_prb_on_checkout_page() {
950942
global $post;
951943

952-
// Message we show for the deprecated PRB location filters. Intended for support so we
953-
// don't provide translations.
954-
$deprecation_message =
955-
'Please configure Payment Request Button locations through the Stripe plugin settings.';
956944
$should_show_on_checkout_page = in_array( 'checkout', $this->get_button_locations(), true );
957945

958-
// Respect the deprecated filters, but add a deprecation notice.
959-
return apply_filters_deprecated(
946+
return apply_filters(
960947
'wc_stripe_show_payment_request_on_checkout',
961-
[ $should_show_on_checkout_page, $post ],
962-
'5.5.0',
963-
'', // There is no replacement.
964-
$deprecation_message
948+
$should_show_on_checkout_page,
949+
$post
965950
);
966951
}
967952

@@ -976,20 +961,13 @@ public function should_show_prb_on_checkout_page() {
976961
public function should_show_prb_on_product_pages() {
977962
global $post;
978963

979-
// Message we show for the deprecated PRB location filters. Intended for support so we
980-
// don't provide translations.
981-
$deprecation_message =
982-
'Please configure Payment Request Button locations through the Stripe plugin settings.';
983964
$should_show_on_product_page = in_array( 'product', $this->get_button_locations(), true );
984965

985-
// Respect the deprecated filters, but add a deprecation notice.
986966
// Note the negation because if the filter returns `true` that means we should hide the PRB.
987-
return ! apply_filters_deprecated(
967+
return ! apply_filters(
988968
'wc_stripe_hide_payment_request_on_product_page',
989-
[ ! $should_show_on_product_page, $post ],
990-
'5.5.0',
991-
'', // There is no replacement.
992-
$deprecation_message
969+
! $should_show_on_product_page,
970+
$post
993971
);
994972
}
995973

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,5 +129,6 @@ If you get stuck, you can ask for help in the Plugin Forum.
129129
== Changelog ==
130130

131131
= 6.3.0 - 2022-xx-xx =
132+
* Tweak - Revert the deprecation of the 'wc_stripe_hide_payment_request_on_product_page', 'wc_stripe_show_payment_request_on_checkout', and 'wc_stripe_show_payment_request_on_cart' filters.
132133

133134
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)