mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +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 {
|
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',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue