Update elementor pro

This commit is contained in:
2026-03-26 14:00:57 +01:00
parent 6af83e92ed
commit aac5b2ea8e
400 changed files with 5807 additions and 1600 deletions

View File

@@ -2,12 +2,15 @@
namespace ElementorPro\Modules\Notes;
use Elementor\Modules\EditorOne\Classes\Menu_Data_Provider;
use Elementor\Settings;
use ElementorPro\Base\Editor_One_Trait;
use ElementorPro\Modules\Notes\Database\Models\Note;
use ElementorPro\Modules\Notes\EditorOneMenuItems\Editor_One_Notes_Proxy_Menu_Item;
use ElementorPro\Modules\Notes\User\Capabilities;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
exit;
}
/**
@@ -16,18 +19,23 @@ if ( ! defined( 'ABSPATH' ) ) {
* before accessing a Note (since Notes aren't available for unauthorized users).
*/
class Admin_Page {
use Editor_One_Trait;
const PAGE_ID = 'elementor-pro-notes-proxy';
/**
* Register actions and hooks.
*
* @return void
*/
const PRIORITY_AFTER_ELEMENTOR = 206;
public function register() {
if ( $this->is_editor_one_active() ) {
add_action( 'elementor/editor-one/menu/register', function ( Menu_Data_Provider $menu_data_provider ) {
$menu_data_provider->register_menu( new Editor_One_Notes_Proxy_Menu_Item( $this ) );
} );
return;
}
add_action( 'admin_menu', function () {
$this->register_admin_menu();
}, 206 ); // After Elementor.
}, static::PRIORITY_AFTER_ELEMENTOR );
add_action( 'admin_head', function () {
$this->hide_menu_item();

View File

@@ -35,7 +35,7 @@ class Note_Query_Builder extends Model_Query_Builder {
*
* @param \wpdb|null $connection
*/
public function __construct( \wpdb $connection = null ) {
public function __construct( ?\wpdb $connection = null ) {
parent::__construct( Note::class, $connection );
}
@@ -72,7 +72,7 @@ class Note_Query_Builder extends Model_Query_Builder {
*
* @return $this
*/
public function with_replies( callable $callback = null ) {
public function with_replies( ?callable $callback = null ) {
$key = 'replies';
$foreign_key = 'parent_id';
$local_key = 'id';

View File

@@ -0,0 +1,57 @@
<?php
namespace ElementorPro\Modules\Notes\EditorOneMenuItems;
use Elementor\Core\Admin\EditorOneMenu\Interfaces\Menu_Item_Interface;
use Elementor\Core\Admin\Menu\Interfaces\Admin_Menu_Item_With_Page;
use Elementor\Modules\EditorOne\Classes\Menu_Config;
use ElementorPro\Modules\Notes\Admin_Page;
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
class Editor_One_Notes_Proxy_Menu_Item implements Menu_Item_Interface, Admin_Menu_Item_With_Page {
private Admin_Page $admin_page;
public function __construct( Admin_Page $admin_page ) {
$this->admin_page = $admin_page;
}
public function get_page_title(): string {
return esc_html__( 'Notes Proxy', 'elementor-pro' );
}
public function get_capability(): string {
return 'read';
}
public function get_label(): string {
return esc_html__( 'Notes Proxy', 'elementor-pro' );
}
public function get_parent_slug(): string {
return Menu_Config::ELEMENTOR_MENU_SLUG;
}
public function is_visible(): bool {
return false;
}
public function get_position(): int {
return 999;
}
public function get_slug(): string {
return Admin_Page::PAGE_ID;
}
public function get_group_id(): string {
return Menu_Config::SYSTEM_GROUP_ID;
}
public function render(): void {
$this->admin_page->on_page_load();
}
}

View File

@@ -167,7 +167,7 @@ class Module extends App {
}
private function on_elementor_pro_init() {
$has_license = API::is_license_active();
$has_license = API::is_license_active() && API::is_licence_has_feature( static::LICENSE_FEATURE_NAME );
if ( ! $has_license ) {
return;