fix get customer tokens limit (#29850)
Make it easier to support many payment methods (within My Account > Payment Methods page). * Update includes/class-wc-payment-tokens.php Better backward-compatible by @jonathansadowski Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com> * Add docblock for new filter `woocommerce_get_customer_payment_tokens_limit`. * Add changelog. Co-authored-by: Yehuda Hassine <yehuda@myinbox.in> Co-authored-by: jonathansadowski <jonathansadowski@users.noreply.github.com> Co-authored-by: barryhughes <3594411+barryhughes@users.noreply.github.com>
This commit is contained in:
parent
abcd2a799a
commit
9337b3b5a6
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: tweak
|
||||
|
||||
Adds new filter `woocommerce_get_customer_payment_tokens_limit` to set limit on number of payment methods fetched within the My Account page.
|
|
@ -74,6 +74,14 @@ class WC_Payment_Tokens {
|
|||
array(
|
||||
'user_id' => $customer_id,
|
||||
'gateway_id' => $gateway_id,
|
||||
/**
|
||||
* Controls the maximum number of Payment Methods that will be listed via the My Account page.
|
||||
*
|
||||
* @since 7.2.0
|
||||
*
|
||||
* @param int $limit Defaults to the value of the `posts_per_page` option.
|
||||
*/
|
||||
'limit' => apply_filters( 'woocommerce_get_customer_payment_tokens_limit', get_option( 'posts_per_page' ) ),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue