PluginProbe
Elementor Website Builder – more than just a page builder / 3.30.0
Elementor Website Builder – more than just a page builder v3.30.0
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / modules / ai / feature-intro / product-image-unification-intro.php

product-image-unification-intro.php in Elementor Website Builder – more than just a page builder 3.30.0, at modules/ai/feature-intro/product-image-unification-intro.php

72 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\Ai\Feature_Intro;
3
4 use Elementor\Core\Upgrade\Manager as Upgrade_Manager;
5 use Elementor\User;
6
7 if ( ! defined( 'ABSPATH' ) ) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Product_Image_Unification_Intro {
12
13 const RELEASE_VERSION = '3.26.0';
14
15 const CURRENT_POINTER_SLUG = 'e-ai-product-image-unification';
16
17 public static function add_hooks() {
18 add_action( 'admin_print_footer_scripts', [ __CLASS__, 'product_image_unification_intro_script' ] );
19 }
20
21 public static function product_image_unification_intro_script() {
22 if ( static::is_dismissed() ) {
23 return;
24 }
25
26 $screen = get_current_screen();
27 if ( ! isset( $screen->post_type ) || 'product' !== $screen->post_type ) {
28 return;
29 }
30
31 wp_enqueue_script( 'wp-pointer' );
32 wp_enqueue_style( 'wp-pointer' );
33
34 $pointer_content = '<h3>' . esc_html__( 'New! Unify pack-shots with Elementor AI', 'elementor' ) . '</h3>';
35 $pointer_content .= '<p>' . esc_html__( 'Now you can process images in bulk and standardized the background and ratio - no manual editing required!', 'elementor' ) . '</p>';
36
37 $pointer_content .= sprintf(
38 '<p><button style="padding: 0; border: 0"><a class="button button-primary" href="%s" target="_blank">%s</a></button></p>',
39 esc_js( 'https://go.elementor.com/wp-dash-unify-images-learn-more/' ),
40 esc_html__( 'Learn more', 'elementor' )
41 );
42
43 ?>
44 <script>
45 jQuery( document ).ready( function( $ ) {
46 setTimeout( function () {
47 $( '#bulk-action-selector-top' ).pointer( {
48 content: '<?php echo $pointer_content; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>',
49 position: {
50 edge: <?php echo is_rtl() ? "'right'" : "'left'"; ?>,
51 align: 'center'
52 },
53 pointerWidth: 360,
54 close: function () {
55 elementorCommon.ajax.addRequest( 'introduction_viewed', {
56 data: {
57 introductionKey: '<?php echo esc_attr( static::CURRENT_POINTER_SLUG ); ?>',
58 },
59 } );
60 }
61 } ).pointer( 'open' );
62 }, 10 );
63 } );
64 </script>
65 <?php
66 }
67
68 private static function is_dismissed() {
69 return User::get_introduction_meta( static::CURRENT_POINTER_SLUG );
70 }
71 }
72