mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-01 07:02:48 +08:00
✨ Add new hook to customize disabled-funding list
This commit is contained in:
parent
ee5237adf5
commit
e9b3cc61d2
1 changed files with 15 additions and 2 deletions
|
@ -96,10 +96,23 @@ class DisabledFundingSources {
|
|||
*/
|
||||
private function get_sources_from_settings() : array {
|
||||
try {
|
||||
return $this->settings->get( 'disable_funding' );
|
||||
// Settings field present in the legacy UI.
|
||||
$disabled_funding = $this->settings->get( 'disable_funding' );
|
||||
} catch ( NotFoundException $exception ) {
|
||||
return array();
|
||||
$disabled_funding = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the list of disabled funding methods. In the legacy UI, this
|
||||
* list was accessible via a settings field.
|
||||
*
|
||||
* This filter allows merchants to programmatically disable funding sources
|
||||
* in the new UI.
|
||||
*/
|
||||
return (array) apply_filters(
|
||||
'woocommerce_paypal_payments_disabled_funding',
|
||||
$disabled_funding
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue