mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( has_block( 'woocommerce-paypal-payments/paylater-messages' ) ) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
$location = $this->location();
|
$location = $this->location();
|
||||||
|
|
||||||
$messaging_enabled_for_current_location = $this->settings_status->is_pay_later_messaging_enabled_for_location( $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;
|
return $messaging_enabled_for_current_location;
|
||||||
case 'block-editor':
|
case 'block-editor':
|
||||||
return true;
|
return true;
|
||||||
|
case 'checkout-block':
|
||||||
|
case 'cart-block':
|
||||||
|
return has_block( 'woocommerce-paypal-payments/paylater-messages' ) || $this->is_block_editor();
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ trait ContextTrait {
|
||||||
/**
|
/**
|
||||||
* Checks if it is the block editor page.
|
* 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' ) ) {
|
if ( ! function_exists( 'get_current_screen' ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue