PluginProbe
Elementor Website Builder – more than just a page builder / 3.4.3
Elementor Website Builder – more than just a page builder v3.4.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
← All changes | modules/admin-top-bar/module.php +17 -10 3.4.23.4.3 View file →
@@ -1,11 +1,9 @@
1 1 <?php
2 -
3 2 namespace Elementor\Modules\AdminTopBar;
4 3
5 4 use Elementor\Core\Base\App as BaseApp;
6 5 use Elementor\Core\Experiments\Manager;
7 -use Elementor\Plugin;
8 6 use Elementor\Utils;
9 7
10 8 if ( ! defined( 'ABSPATH' ) ) {
11 9 exit; // Exit if accessed directly.
@@ -93,17 +91,26 @@
93 91 */
94 92 public function __construct() {
95 93 parent::__construct();
96 94
97 - add_action( 'in_admin_header', function () {
98 - $this->render_admin_top_bar();
99 - } );
95 + add_action( 'current_screen', function () {
96 + $current_screen = get_current_screen();
100 97
101 - add_action( 'admin_enqueue_scripts', function () {
102 - $this->enqueue_scripts();
103 - } );
98 + // Only in elementor based pages.
99 + if ( ! $current_screen || ! strstr( $current_screen->id, 'elementor' ) ) {
100 + return;
101 + }
104 102
105 - add_action( 'wp_dashboard_setup', function () {
106 - $this->register_dashboard_widgets();
103 + add_action( 'in_admin_header', function () {
104 + $this->render_admin_top_bar();
105 + } );
106 +
107 + add_action( 'admin_enqueue_scripts', function () {
108 + $this->enqueue_scripts();
109 + } );
110 +
111 + add_action( 'wp_dashboard_setup', function () {
112 + $this->register_dashboard_widgets();
113 + } );
107 114 } );
108 115 }
109 116 }