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 {
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',