mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
fix checking for feature flag
This commit is contained in:
parent
13d27a016e
commit
be885ba546
1 changed files with 25 additions and 22 deletions
|
@ -45,29 +45,32 @@ class OnboardingModule implements ServiceModule, ExtendingModule, ExecutableModu
|
|||
*/
|
||||
public function run( ContainerInterface $c ): bool {
|
||||
|
||||
if ( ! apply_filters(
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.settings_enabled',
|
||||
getenv( 'PCP_SETTINGS_ENABLED' ) === '1'
|
||||
) || SettingsModule::should_use_the_old_ui()
|
||||
) {
|
||||
add_action(
|
||||
'admin_enqueue_scripts',
|
||||
function() use ( $c ) {
|
||||
$asset_loader = $c->get( 'onboarding.assets' );
|
||||
assert( $asset_loader instanceof OnboardingAssets );
|
||||
|
||||
$asset_loader->register();
|
||||
add_action(
|
||||
'woocommerce_settings_checkout',
|
||||
array(
|
||||
$asset_loader,
|
||||
'enqueue',
|
||||
)
|
||||
);
|
||||
add_action(
|
||||
'admin_enqueue_scripts',
|
||||
function() use ( $c ) {
|
||||
if (
|
||||
apply_filters(
|
||||
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
|
||||
'woocommerce.feature-flags.woocommerce_paypal_payments.settings_enabled',
|
||||
getenv( 'PCP_SETTINGS_ENABLED' ) === '1'
|
||||
) && ! SettingsModule::should_use_the_old_ui()
|
||||
) {
|
||||
return;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
$asset_loader = $c->get( 'onboarding.assets' );
|
||||
assert( $asset_loader instanceof OnboardingAssets );
|
||||
|
||||
$asset_loader->register();
|
||||
add_action(
|
||||
'woocommerce_settings_checkout',
|
||||
array(
|
||||
$asset_loader,
|
||||
'enqueue',
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
add_filter(
|
||||
'woocommerce_form_field',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue