mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-04 08:47:23 +08:00
Extract module flag check
This commit is contained in:
parent
31c90c149e
commit
16fbb5b4d1
2 changed files with 13 additions and 4 deletions
|
@ -19,6 +19,17 @@ use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|||
* Class PayLaterBlockModule
|
||||
*/
|
||||
class PayLaterBlockModule implements ModuleInterface {
|
||||
/**
|
||||
* Returns whether the block should be loaded.
|
||||
*/
|
||||
public static function is_enabled(): bool {
|
||||
return apply_filters(
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.paylater_block_enabled',
|
||||
getenv( 'PCP_PAYLATER_BLOCK' ) !== '0'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue