| @@ -1,11 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | namespace Elementor\Modules\AdminTopBar; |
| 3 | 3 | |
| 4 | -use Elementor\Core\Admin\Admin; | |
| 5 | 4 | use Elementor\Core\Utils\Promotions\Filtered_Promotions_Manager; |
| 6 | 5 | use Elementor\Plugin; |
| 7 | 6 | use Elementor\Core\Base\App as BaseApp; |
| 7 | +use Elementor\Core\Experiments\Manager; | |
| 8 | 8 | use Elementor\Utils; |
| 9 | 9 | |
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | 11 | exit; // Exit if accessed directly. |
| @@ -39,9 +39,9 @@ | ||
| 39 | 39 | */ |
| 40 | 40 | private function enqueue_scripts() { |
| 41 | 41 | wp_enqueue_style( 'elementor-admin-top-bar-fonts', 'https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap', [], ELEMENTOR_VERSION ); |
| 42 | 42 | |
| 43 | - wp_enqueue_style( 'elementor-admin-top-bar', $this->get_css_assets_url( 'admin-top-bar' ), [], ELEMENTOR_VERSION ); | |
| 43 | + wp_enqueue_style( 'elementor-admin-top-bar', $this->get_css_assets_url( 'admin-top-bar', null, 'default', true ), [], ELEMENTOR_VERSION ); | |
| 44 | 44 | |
| 45 | 45 | /** |
| 46 | 46 | * Before admin top bar enqueue scripts. |
| 47 | 47 | * |
| @@ -110,11 +110,18 @@ | ||
| 110 | 110 | |
| 111 | 111 | private function is_top_bar_active() { |
| 112 | 112 | $current_screen = get_current_screen(); |
| 113 | 113 | |
| 114 | + if ( ! $current_screen ) { | |
| 115 | + return false; | |
| 116 | + } | |
| 117 | + | |
| 118 | + $is_elementor_page = strpos( $current_screen->id ?? '', 'elementor' ) !== false; | |
| 119 | + $is_elementor_post_type_page = strpos( $current_screen->post_type ?? '', 'elementor' ) !== false; | |
| 120 | + | |
| 114 | 121 | return apply_filters( |
| 115 | 122 | 'elementor/admin-top-bar/is-active', |
| 116 | - Admin::is_elementor_admin_page( $current_screen ), | |
| 123 | + $is_elementor_page || $is_elementor_post_type_page, | |
| 117 | 124 | $current_screen |
| 118 | 125 | ); |
| 119 | 126 | } |
| 120 | 127 | |