mirror of
https://github.com/proelements/proelements.git
synced 2026-04-06 04:13:48 +00:00
v3.35.0
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user