Add new hook to customize disabled-funding list

This commit is contained in:
Philipp Stracker 2025-03-18 16:18:19 +01:00
parent ee5237adf5
commit e9b3cc61d2
No known key found for this signature in database

View file

@ -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
);
}
/**