fix checking for feature flag

This commit is contained in:
Daniel Hüsken 2024-11-26 11:13:31 +01:00
parent 13d27a016e
commit be885ba546
No known key found for this signature in database
GPG key ID: 9F732DA37FA709E8

View file

@ -45,29 +45,32 @@ class OnboardingModule implements ServiceModule, ExtendingModule, ExecutableModu
*/ */
public function run( ContainerInterface $c ): bool { public function run( ContainerInterface $c ): bool {
if ( ! apply_filters( add_action(
// phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 'admin_enqueue_scripts',
'woocommerce.feature-flags.woocommerce_paypal_payments.settings_enabled', function() use ( $c ) {
getenv( 'PCP_SETTINGS_ENABLED' ) === '1' if (
) || SettingsModule::should_use_the_old_ui() apply_filters(
) { // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
add_action( 'woocommerce.feature-flags.woocommerce_paypal_payments.settings_enabled',
'admin_enqueue_scripts', getenv( 'PCP_SETTINGS_ENABLED' ) === '1'
function() use ( $c ) { ) && ! SettingsModule::should_use_the_old_ui()
$asset_loader = $c->get( 'onboarding.assets' ); ) {
assert( $asset_loader instanceof OnboardingAssets ); return;
$asset_loader->register();
add_action(
'woocommerce_settings_checkout',
array(
$asset_loader,
'enqueue',
)
);
} }
);
} $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( add_filter(
'woocommerce_form_field', 'woocommerce_form_field',