← All changes
|
modules/optimization/components/list-view-pointer.php
+15
-5
1.4.1
→
1.7.7
View file →
| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace ImageOptimization\Modules\Optimization\Components; |
| 4 | 4 | |
| 5 | 5 | use ImageOptimization\Modules\Core\Components\Pointers; |
| 6 | +use ImageOptimization\Modules\Core\Module as Core_Module; | |
| 6 | 7 | |
| 7 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 8 | 9 | exit; // Exit if accessed directly. |
| 9 | 10 | } |
| @@ -11,8 +12,12 @@ | ||
| 11 | 12 | class List_View_Pointer { |
| 12 | 13 | const CURRENT_POINTER_SLUG = 'image-optimizer-list-view'; |
| 13 | 14 | |
| 14 | 15 | public function admin_print_script() { |
| 16 | + if ( Core_Module::is_elementor_one() ) { | |
| 17 | + return; | |
| 18 | + } | |
| 19 | + | |
| 15 | 20 | if ( $this->is_dismissed() ) { |
| 16 | 21 | return; |
| 17 | 22 | } |
| 18 | 23 | |
| @@ -19,9 +24,9 @@ | ||
| 19 | 24 | wp_enqueue_script( 'wp-pointer' ); |
| 20 | 25 | wp_enqueue_style( 'wp-pointer' ); |
| 21 | 26 | |
| 22 | 27 | $pointer_content = '<h3>' . esc_html__( 'Switch to list view', 'image-optimization' ) . '</h3>'; |
| 23 | - $pointer_content .= '<p>' . esc_html__( 'Get the most out of your optimizing options. Use the List view to quickly optimize your uploaded images with Image Optimizer.', 'image-optimization' ) . '</p>'; | |
| 28 | + $pointer_content .= '<p>' . esc_html__( 'Get the most out of your optimizing options. Use the List view to quickly optimize your uploaded images with Image Optimization.', 'image-optimization' ) . '</p>'; | |
| 24 | 29 | |
| 25 | 30 | $allowed_tags = [ |
| 26 | 31 | 'h3' => [], |
| 27 | 32 | 'p' => [], |
| @@ -37,13 +42,18 @@ | ||
| 37 | 42 | edge: 'top', |
| 38 | 43 | align: '<?php echo is_rtl() ? 'right' : 'left'; ?>', |
| 39 | 44 | }, |
| 40 | 45 | close() { |
| 41 | - wp.ajax.post( 'image_optimizer_pointer_dismissed', { | |
| 46 | + return jQuery.ajax( { | |
| 47 | + url: ajaxurl, | |
| 48 | + method: 'POST', | |
| 42 | 49 | data: { |
| 43 | - pointer: '<?php echo esc_attr( static::CURRENT_POINTER_SLUG ); ?>', | |
| 44 | - }, | |
| 45 | - nonce: '<?php echo esc_attr( wp_create_nonce( 'image-optimization-pointer-dismissed' ) ); ?>', | |
| 50 | + action: 'image_optimizer_pointer_dismissed', | |
| 51 | + data: { | |
| 52 | + pointer: '<?php echo esc_attr( static::CURRENT_POINTER_SLUG ); ?>' | |
| 53 | + }, | |
| 54 | + nonce: '<?php echo esc_attr( wp_create_nonce( 'image-optimization-pointer-dismissed' ) ); ?>' | |
| 55 | + } | |
| 46 | 56 | } ); |
| 47 | 57 | } |
| 48 | 58 | } ).pointer( 'open' ); |
| 49 | 59 | }, 0) |