mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
Fix messages check in editor
This commit is contained in:
parent
a99fbc6eb3
commit
93997fac7e
2 changed files with 4 additions and 5 deletions
|
@ -620,10 +620,6 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages
|
|||
return false;
|
||||
}
|
||||
|
||||
if ( has_block( 'woocommerce-paypal-payments/paylater-messages' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$location = $this->location();
|
||||
|
||||
$messaging_enabled_for_current_location = $this->settings_status->is_pay_later_messaging_enabled_for_location( $location );
|
||||
|
@ -638,6 +634,9 @@ document.querySelector("#payment").before(document.querySelector("#ppcp-messages
|
|||
return $messaging_enabled_for_current_location;
|
||||
case 'block-editor':
|
||||
return true;
|
||||
case 'checkout-block':
|
||||
case 'cart-block':
|
||||
return has_block( 'woocommerce-paypal-payments/paylater-messages' ) || $this->is_block_editor();
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -182,7 +182,7 @@ trait ContextTrait {
|
|||
/**
|
||||
* Checks if it is the block editor page.
|
||||
*/
|
||||
private function is_block_editor(): bool {
|
||||
protected function is_block_editor(): bool {
|
||||
if ( ! function_exists( 'get_current_screen' ) ) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue