| @@ -28,9 +28,8 @@ | ||
| 28 | 28 | self::HISTORY_TYPE_CODE, |
| 29 | 29 | self::HISTORY_TYPE_IMAGE, |
| 30 | 30 | self::HISTORY_TYPE_BLOCK, |
| 31 | 31 | ]; |
| 32 | - const MIN_PAGES_FOR_CREATE_WITH_AI_BANNER = 10; | |
| 33 | 32 | |
| 34 | 33 | public function get_name() { |
| 35 | 34 | return 'ai'; |
| 36 | 35 | } |
| @@ -48,10 +47,8 @@ | ||
| 48 | 47 | if ( ! $this->is_ai_enabled() ) { |
| 49 | 48 | return; |
| 50 | 49 | } |
| 51 | 50 | |
| 52 | - add_filter( 'elementor/core/admin/homescreen', [ $this, 'add_create_with_ai_banner_to_homescreen' ] ); | |
| 53 | - | |
| 54 | 51 | add_action( 'elementor/connect/apps/register', function ( ConnectModule $connect_module ) { |
| 55 | 52 | $connect_module->register_app( 'ai', Ai::get_class_name() ); |
| 56 | 53 | } ); |
| 57 | 54 | |
| @@ -1111,10 +1108,8 @@ | ||
| 1111 | 1108 | ]; |
| 1112 | 1109 | } |
| 1113 | 1110 | |
| 1114 | 1111 | public function ajax_ai_upload_image( $data ) { |
| 1115 | - $this->verify_upload_permissions( $data ); | |
| 1116 | - | |
| 1117 | 1112 | if ( empty( $data['image'] ) ) { |
| 1118 | 1113 | throw new \Exception( 'Missing image data' ); |
| 1119 | 1114 | } |
| 1120 | 1115 | |
| @@ -1549,49 +1544,6 @@ | ||
| 1549 | 1544 | } |
| 1550 | 1545 | |
| 1551 | 1546 | $product->set_gallery_image_ids( $gallery_image_ids ); |
| 1552 | 1547 | $product->save(); |
| 1553 | - } | |
| 1554 | - | |
| 1555 | - private function should_display_create_with_ai_banner() { | |
| 1556 | - $elementor_pages = new \WP_Query( [ | |
| 1557 | - 'post_type' => 'page', | |
| 1558 | - 'post_status' => 'publish', | |
| 1559 | - 'fields' => 'ids', | |
| 1560 | - 'posts_per_page' => self::MIN_PAGES_FOR_CREATE_WITH_AI_BANNER + 1, | |
| 1561 | - ] ); | |
| 1562 | - | |
| 1563 | - if ( $elementor_pages->post_count > self::MIN_PAGES_FOR_CREATE_WITH_AI_BANNER ) { | |
| 1564 | - return false; | |
| 1565 | - } | |
| 1566 | - | |
| 1567 | - if ( Utils::is_custom_kit_applied() ) { | |
| 1568 | - return false; | |
| 1569 | - } | |
| 1570 | - | |
| 1571 | - return true; | |
| 1572 | - } | |
| 1573 | - | |
| 1574 | - private function get_create_with_ai_banner_data() { | |
| 1575 | - return [ | |
| 1576 | - 'title' => 'Create and launch your site faster with AI', | |
| 1577 | - 'description' => 'Share your vision with our AI Chat and watch as it becomes a brief, sitemap, and wireframes in minutes:', | |
| 1578 | - 'input_placeholder' => 'Start describing the site you want to create...', | |
| 1579 | - 'button_title' => 'Create with AI', | |
| 1580 | - 'button_cta_url' => 'http://planner.elementor.com/chat.html', | |
| 1581 | - 'background_image' => ELEMENTOR_ASSETS_URL . 'images/app/ai/ai-site-creator-homepage-bg.svg', | |
| 1582 | - 'utm_source' => 'editor-home', | |
| 1583 | - 'utm_medium' => 'wp-dash', | |
| 1584 | - 'utm_campaign' => 'generate-with-ai', | |
| 1585 | - ]; | |
| 1586 | - } | |
| 1587 | - | |
| 1588 | - public function add_create_with_ai_banner_to_homescreen( $home_screen_data ) { | |
| 1589 | - if ( $this->should_display_create_with_ai_banner() ) { | |
| 1590 | - $home_screen_data['create_with_ai'] = $this->get_create_with_ai_banner_data(); | |
| 1591 | - } else { | |
| 1592 | - $home_screen_data['create_with_ai'] = null; | |
| 1593 | - } | |
| 1594 | - | |
| 1595 | - return $home_screen_data; | |
| 1596 | 1548 | } |
| 1597 | 1549 | } |