PluginProbe
Elementor Website Builder – more than just a page builder / 3.17.2
Elementor Website Builder – more than just a page builder v3.17.2
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 +10 -23 4.2.23.17.2 View file →
@@ -1,11 +1,10 @@
1 1 <?php
2 2 namespace Elementor\Modules\AdminTopBar;
3 3
4 -use Elementor\Core\Admin\Admin;
5 -use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager;
6 4 use Elementor\Plugin;
7 5 use Elementor\Core\Base\App as BaseApp;
6 +use Elementor\Core\Experiments\Manager;
8 7 use Elementor\Utils;
9 8
10 9 if ( ! defined( 'ABSPATH' ) ) {
11 10 exit; // Exit if accessed directly.
@@ -39,19 +38,10 @@
39 38 */
40 39 private function enqueue_scripts() {
41 40 wp_enqueue_style( 'elementor-admin-top-bar-fonts', 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap', [], ELEMENTOR_VERSION );
42 41
43 - wp_enqueue_style( 'elementor-admin-top-bar', $this->get_css_assets_url( 'admin-top-bar' ), [], ELEMENTOR_VERSION );
42 + wp_enqueue_style( 'elementor-admin-top-bar', $this->get_css_assets_url( 'admin-top-bar', null, 'default', true ), [], ELEMENTOR_VERSION );
44 43
45 - /**
46 - * Before admin top bar enqueue scripts.
47 - *
48 - * Fires before Elementor admin top bar scripts are enqueued.
49 - *
50 - * @since 3.19.0
51 - */
52 - do_action( 'elementor/admin_top_bar/before_enqueue_scripts', $this );
53 -
54 44 wp_enqueue_script( 'elementor-admin-top-bar', $this->get_js_assets_url( 'admin-top-bar' ), [
55 45 'elementor-common',
56 46 'react',
57 47 'react-dom',
@@ -74,19 +64,9 @@
74 64 $settings['is_administrator'] = current_user_can( 'manage_options' );
75 65
76 66 // TODO: Find a better way to add apps page url to the admin top bar.
77 67 $settings['apps_url'] = admin_url( 'admin.php?page=elementor-apps' );
78 - $settings['promotion'] = [
79 - 'text' => __( 'Upgrade Now', 'elementor' ),
80 - 'url' => 'https://go.elementor.com/wp-dash-admin-top-bar-upgrade/',
81 - ];
82 68
83 - $settings['promotion'] = Filtered_Promotions_Manager::get_filtered_promotion_data(
84 - $settings['promotion'],
85 - 'elementor/admin_top_bar/go_pro_promotion',
86 - 'url'
87 - );
88 -
89 69 $current_screen = get_current_screen();
90 70
91 71 /** @var \Elementor\Core\Common\Modules\Connect\Apps\Library $library */
92 72 $library = Plugin::$instance->common->get_component( 'connect' )->get_app( 'library' );
@@ -110,11 +90,18 @@
110 90
111 91 private function is_top_bar_active() {
112 92 $current_screen = get_current_screen();
113 93
94 + if ( ! $current_screen ) {
95 + return false;
96 + }
97 +
98 + $is_elementor_page = strpos( $current_screen->id ?? '', 'elementor' ) !== false;
99 + $is_elementor_post_type_page = strpos( $current_screen->post_type ?? '', 'elementor' ) !== false;
100 +
114 101 return apply_filters(
115 102 'elementor/admin-top-bar/is-active',
116 - Admin::is_elementor_admin_page( $current_screen ),
103 + $is_elementor_page || $is_elementor_post_type_page,
117 104 $current_screen
118 105 );
119 106 }
120 107