| 1 |
<?php |
| 2 |
namespace Elementor\App\Modules\SiteEditor; |
| 3 |
|
| 4 |
use Elementor\Core\Base\Module as BaseModule; |
| 5 |
use Elementor\Plugin; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
/** |
| 12 |
* Site Editor Module |
| 13 |
* |
| 14 |
* Responsible for initializing Elementor App functionality |
| 15 |
*/ |
| 16 |
class Module extends BaseModule { |
| 17 |
/** |
| 18 |
* Get name. |
| 19 |
* |
| 20 |
* @access public |
| 21 |
* |
| 22 |
* @return string |
| 23 |
*/ |
| 24 |
public function get_name() { |
| 25 |
return 'site-editor'; |
| 26 |
} |
| 27 |
|
| 28 |
public function add_menu_in_admin_bar( $admin_bar_config ) { |
| 29 |
$admin_bar_config['elementor_edit_page']['children'][] = [ |
| 30 |
'id' => 'elementor_app_site_editor', |
| 31 |
'title' => esc_html__( 'Theme Builder', 'elementor' ), |
| 32 |
'sub_title' => esc_html__( 'Site', 'elementor' ), |
| 33 |
'href' => Plugin::$instance->app->get_settings( 'menu_url' ), |
| 34 |
'class' => 'elementor-app-link', |
| 35 |
'parent_class' => 'elementor-second-section', |
| 36 |
]; |
| 37 |
|
| 38 |
return $admin_bar_config; |
| 39 |
} |
| 40 |
|
| 41 |
public function __construct() { |
| 42 |
add_filter( 'elementor/frontend/admin_bar/settings', [ $this, 'add_menu_in_admin_bar' ] ); // After kit (Site settings) |
| 43 |
} |
| 44 |
} |
| 45 |
|