mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Remove compat Elementor checkout context
This commit is contained in:
parent
3b80ec8333
commit
51cfbfb050
1 changed files with 0 additions and 26 deletions
|
@ -78,7 +78,6 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
|||
|
||||
$this->fix_page_builders();
|
||||
$this->exclude_cache_plugins_js_minification( $c );
|
||||
$this->set_elementor_checkout_context();
|
||||
|
||||
$is_nyp_active = $c->get( 'compat.nyp.is_supported_plugin_version_active' );
|
||||
if ( $is_nyp_active ) {
|
||||
|
@ -435,31 +434,6 @@ class CompatModule implements ServiceModule, ExtendingModule, ExecutableModule {
|
|||
return ( $parent && $parent->get( 'Name' ) === 'Divi' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the context for the Elementor checkout page.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function set_elementor_checkout_context(): void {
|
||||
add_action(
|
||||
'wp',
|
||||
function () {
|
||||
$page_id = get_the_ID();
|
||||
if ( ! is_numeric( $page_id ) || ! CartCheckoutDetector::has_elementor_checkout( (int) $page_id ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
add_filter(
|
||||
'woocommerce_paypal_payments_context',
|
||||
function ( string $context ): string {
|
||||
// Default context.
|
||||
return ( 'mini-cart' === $context ) ? 'checkout' : $context;
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Excludes PayPal scripts from being minified by cache plugins.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue