← All changes
|
vendor/hostinger/hostinger-wp-menu-manager/src/Assets.php
+12
-9
3.0.68
→
trunk
View file →
| @@ -37,12 +37,13 @@ | ||
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @return void |
| 40 | 40 | */ |
| 41 | - public function enqueueAdminAssets(): void { | |
| 41 | + public function enqueueAdminAssets(): void | |
| 42 | + { | |
| 42 | 43 | $defaultVersion = '1.0.0'; |
| 43 | 44 | |
| 44 | - if ( $this->isHostingerMenuPage() ) { | |
| 45 | + if ($this->isHostingerMenuPage()) { | |
| 45 | 46 | $pluginInfo = $this->manager->getPluginInfo(); |
| 46 | 47 | $jsScriptPath = __DIR__ . '/../assets/js/menus.min.js'; |
| 47 | 48 | $cssStylePath = __DIR__ . '/../assets/css/style.min.css'; |
| 48 | 49 | |
| @@ -50,9 +51,10 @@ | ||
| 50 | 51 | if (file_exists($jsScriptPath)) { |
| 51 | 52 | $jsVersion = filemtime($jsScriptPath) ?: $jsVersion; |
| 52 | 53 | } |
| 53 | 54 | |
| 54 | - wp_enqueue_script( 'hostinger_menu_scripts', | |
| 55 | + wp_enqueue_script( | |
| 56 | + 'hostinger_menu_scripts', | |
| 55 | 57 | $pluginInfo . $this->assetsPath . '/js/menus.min.js', |
| 56 | 58 | [ 'jquery' ], |
| 57 | 59 | $jsVersion, |
| 58 | 60 | false |
| @@ -62,9 +64,10 @@ | ||
| 62 | 64 | if (file_exists($cssStylePath)) { |
| 63 | 65 | $cssVersion = filemtime($cssStylePath) ?: $cssVersion; |
| 64 | 66 | } |
| 65 | 67 | |
| 66 | - wp_enqueue_style( 'hostinger_menu_styles', | |
| 68 | + wp_enqueue_style( | |
| 69 | + 'hostinger_menu_styles', | |
| 67 | 70 | $pluginInfo . $this->assetsPath . '/css/style.min.css', |
| 68 | 71 | [], |
| 69 | 72 | $cssVersion |
| 70 | 73 | ); |
| @@ -70,17 +73,17 @@ | ||
| 70 | 73 | ); |
| 71 | 74 | |
| 72 | 75 | // Hide notices and badges in Hostinger menu pages. |
| 73 | 76 | $hide_notices = '.notice { display: none !important; } .hostinger-notice { display: block !important; }'; |
| 74 | - wp_add_inline_style( 'hostinger_menu_styles', $hide_notices ); | |
| 77 | + wp_add_inline_style('hostinger_menu_styles', $hide_notices); | |
| 75 | 78 | |
| 76 | - if ( Utils::isPluginActive( 'wpforms' ) ) { | |
| 79 | + if (Utils::isPluginActive('wpforms')) { | |
| 77 | 80 | $hide_wp_forms_counter = '.wp-admin #wpadminbar .wpforms-menu-notification-counter { display: none !important; }'; |
| 78 | - wp_add_inline_style( 'hostinger_menu_styles', $hide_wp_forms_counter ); | |
| 81 | + wp_add_inline_style('hostinger_menu_styles', $hide_wp_forms_counter); | |
| 79 | 82 | } |
| 80 | - if ( Utils::isPluginActive( 'googleanalytics' ) ) { | |
| 83 | + if (Utils::isPluginActive('googleanalytics')) { | |
| 81 | 84 | $hide_monsterinsights_notification = '.wp-admin .monsterinsights-menu-notification-indicator { display: none !important; }'; |
| 82 | - wp_add_inline_style( 'hostinger_menu_styles', $hide_monsterinsights_notification ); | |
| 85 | + wp_add_inline_style('hostinger_menu_styles', $hide_monsterinsights_notification); | |
| 83 | 86 | } |
| 84 | 87 | } |
| 85 | 88 | } |
| 86 | 89 | |