| @@ -41,17 +41,13 @@ | ||
| 41 | 41 | private function enqueue_scripts() { |
| 42 | 42 | wp_enqueue_script( |
| 43 | 43 | 'announcements-app', |
| 44 | 44 | $this->get_js_assets_url( 'announcements-app' ), |
| 45 | - [ | |
| 46 | - 'wp-i18n', | |
| 47 | - ], | |
| 45 | + [], | |
| 48 | 46 | ELEMENTOR_VERSION, |
| 49 | 47 | true |
| 50 | 48 | ); |
| 51 | 49 | |
| 52 | - wp_set_script_translations( 'announcements-app', 'elementor' ); | |
| 53 | - | |
| 54 | 50 | $this->print_config( 'announcements-app' ); |
| 55 | 51 | } |
| 56 | 52 | |
| 57 | 53 | /** |
| @@ -64,9 +60,9 @@ | ||
| 64 | 60 | $additional_settings = []; |
| 65 | 61 | |
| 66 | 62 | foreach ( $active_announcements as $announcement ) { |
| 67 | 63 | $additional_settings[] = $announcement->get_prepared_data(); |
| 68 | - // @TODO - replace with ajax request from the front after actually triggered | |
| 64 | + //@TODO - replace with ajax request from the front after actually triggered | |
| 69 | 65 | $announcement->after_triggered(); |
| 70 | 66 | } |
| 71 | 67 | |
| 72 | 68 | return [ |
| @@ -91,9 +87,41 @@ | ||
| 91 | 87 | * |
| 92 | 88 | * @return array[] |
| 93 | 89 | */ |
| 94 | 90 | private function get_raw_announcements(): array { |
| 95 | - $raw_announcements = []; | |
| 91 | + $raw_announcements = [ | |
| 92 | + [ | |
| 93 | + 'title' => 'Unlock the Power of Elementor AI', | |
| 94 | + 'description' => '<p>Design professional websites with natively integrated AI tools.</p> | |
| 95 | + <ul> | |
| 96 | + <li>Boost creativity & productivity with AI-generated containers. Build layouts from scratch or existing Elementor containers. Generate containers from any layout you reference from the web!</li> | |
| 97 | + <li>Let AI write or edit your text, adjust its length and tone of voice. Also generate custom code that seamlessly integrates into your website.</li> | |
| 98 | + <li>Create one-of-a kind images, add, or erase content in existing images or expand them beyond their original size and aspect ratio.</li> | |
| 99 | + <li>Access and repurpose previously-generated text, code or image prompts with Elementor’s AI History Panel to work efficiently and ensure consistency.</li> | |
| 100 | + </ul>', | |
| 101 | + 'media' => [ | |
| 102 | + 'type' => 'image', | |
| 103 | + 'src' => ELEMENTOR_ASSETS_URL . 'images/announcement.png?' . ELEMENTOR_VERSION, | |
| 104 | + ], | |
| 105 | + 'cta' => [ | |
| 106 | + [ | |
| 107 | + 'label' => 'Continue', | |
| 108 | + 'variant' => 'primary', | |
| 109 | + 'target' => '_blank', | |
| 110 | + ], | |
| 111 | + [ | |
| 112 | + 'label' => 'Learn More', | |
| 113 | + 'target' => '_blank', | |
| 114 | + 'url' => 'https://go.elementor.com/whats-new-popup-learn-elementor-ai/', | |
| 115 | + ], | |
| 116 | + ], | |
| 117 | + 'triggers' => [ | |
| 118 | + [ | |
| 119 | + 'action' => 'aiStared', | |
| 120 | + ], | |
| 121 | + ], | |
| 122 | + ], | |
| 123 | + ]; | |
| 96 | 124 | |
| 97 | 125 | // DO NOT USE THIS FILTER |
| 98 | 126 | return apply_filters( 'elementor/announcements/raw_announcements', $raw_announcements ); |
| 99 | 127 | } |