| @@ -2,9 +2,9 @@ | ||
| 2 | 2 | namespace Elementor\Modules\Apps; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Core\Admin\Menu\Admin_Menu_Manager; |
| 5 | 5 | use Elementor\Core\Base\Module as BaseModule; |
| 6 | -use Elementor\Plugin; | |
| 6 | +use Elementor\Settings; | |
| 7 | 7 | |
| 8 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 9 | 9 | exit; // Exit if accessed directly. |
| 10 | 10 | } |
| @@ -20,8 +20,18 @@ | ||
| 20 | 20 | public function __construct() { |
| 21 | 21 | parent::__construct(); |
| 22 | 22 | |
| 23 | 23 | Admin_Pointer::add_hooks(); |
| 24 | + | |
| 25 | + add_action( 'elementor/admin/menu/register', function( Admin_Menu_Manager $admin_menu ) { | |
| 26 | + $admin_menu->register( static::PAGE_ID, new Admin_Menu_Apps() ); | |
| 27 | + }, 115 ); | |
| 28 | + | |
| 29 | + add_action( 'elementor/admin/menu/after_register', function ( Admin_Menu_Manager $admin_menu, array $hooks ) { | |
| 30 | + if ( ! empty( $hooks[ static::PAGE_ID ] ) ) { | |
| 31 | + add_action( "admin_print_scripts-{$hooks[ static::PAGE_ID ]}", [ $this, 'enqueue_assets' ] ); | |
| 32 | + } | |
| 33 | + }, 10, 2 ); | |
| 24 | 34 | |
| 25 | 35 | add_filter( 'elementor/finder/categories', function( array $categories ) { |
| 26 | 36 | $categories['site']['items']['apps'] = [ |
| 27 | 37 | 'title' => esc_html__( 'Add-ons', 'elementor' ), |