Merge pull request #1856 from woocommerce/PCP-2328-remove-the-home-location-from-default-enabled-pay-later-messaging-locations

Remove the Home location from default enabled Pay Later messaging locations (2328)
This commit is contained in:
Pedro Silva 2023-11-24 09:47:14 +00:00 committed by GitHub
commit 4827fbd455
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -1379,7 +1379,9 @@ return array(
);
},
'wcgateway.settings.pay-later.default-messaging-locations' => static function( ContainerInterface $container ): array {
return array_keys( $container->get( 'wcgateway.settings.pay-later.messaging-locations' ) );
$locations = $container->get( 'wcgateway.settings.pay-later.messaging-locations' );
unset( $locations['home'] );
return array_keys( $locations );
},
'wcgateway.settings.pay-later.button-locations' => static function( ContainerInterface $container ): array {
$settings = $container->get( 'wcgateway.settings' );

View file

@ -184,7 +184,7 @@ class SettingsPageAssets {
}
$screen = get_current_screen();
if ( $screen->id !== 'woocommerce_page_wc-settings' ) {
if ( ! $screen || $screen->id !== 'woocommerce_page_wc-settings' ) {
return false;
}