PluginProbe
Hostinger Tools / 2.1.1
Hostinger Tools v2.1.1
3.0.77 3.0.76 3.0.75 3.0.74 3.0.73 3.0.72 3.0.71 3.0.70 3.0.69 3.0.68 3.0.67 3.0.66 1.8.1 1.8.2 1.8.3 1.9.1 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.4 All 108 releases
← All changes | includes/admin/class-hostinger-admin-assets.php +57 -16 2.0.12.1.1 View file →
@@ -26,10 +26,16 @@
26 26 */
27 27 public function admin_styles(): void {
28 28 if ( $this->helper->is_hostinger_admin_page() ) {
29 29 wp_enqueue_style( 'hostinger_main_styles', HOSTINGER_ASSETS_URL . '/css/main.css', array(), HOSTINGER_VERSION );
30 +
31 + if ( Hostinger_Helper::show_woocommerce_onboarding() ) {
32 + wp_enqueue_style( 'hostinger_woo_onboarding', HOSTINGER_ASSETS_URL . '/css/woo-onboarding.css', array(), HOSTINGER_VERSION );
33 + }
30 34 }
31 35
36 + wp_enqueue_style( 'hostinger_global_styles', HOSTINGER_ASSETS_URL . '/css/global.css', array(), HOSTINGER_VERSION );
37 +
32 38 if ( $this->helper->is_preview_domain() && is_user_logged_in() ) {
33 39 wp_enqueue_style( 'hostinger-preview-styles', HOSTINGER_ASSETS_URL . '/css/hts-preview.css', array(), HOSTINGER_VERSION );
34 40 }
35 41 }
@@ -38,28 +44,63 @@
38 44 * Enqueues scripts for the Hostinger admin pages.
39 45 */
40 46 public function admin_scripts(): void {
41 47 if ( $this->helper->is_hostinger_admin_page() ) {
42 - wp_enqueue_script( 'hostinger_main_scripts', HOSTINGER_ASSETS_URL . '/js/main.js', array(
48 + wp_enqueue_script(
49 + 'hostinger_main_scripts',
50 + HOSTINGER_ASSETS_URL . '/js/main.js',
51 + array(
52 + 'jquery',
53 + 'wp-i18n',
54 + ),
55 + HOSTINGER_VERSION,
56 + false
57 + );
58 +
59 + if ( Hostinger_Helper::show_woocommerce_onboarding() ) {
60 + wp_enqueue_script(
61 + 'hostinger_woo_onboarding',
62 + HOSTINGER_ASSETS_URL . '/js/woo-onboarding.js',
63 + array(
64 + 'jquery',
65 + 'wp-i18n',
66 + ),
67 + HOSTINGER_VERSION,
68 + false
69 + );
70 + }
71 + }
72 +
73 + wp_enqueue_script(
74 + 'hostinger_global_scripts',
75 + HOSTINGER_ASSETS_URL . '/js/global-scripts.js',
76 + array(
43 77 'jquery',
44 78 'wp-i18n',
45 - ), HOSTINGER_VERSION, false );
46 - }
79 + ),
80 + HOSTINGER_VERSION,
81 + false
82 + );
47 83
48 - wp_enqueue_script( 'hostinger_global_scripts', HOSTINGER_ASSETS_URL . '/js/global-scripts.js', array(
49 - 'jquery',
50 - 'wp-i18n',
51 - ), HOSTINGER_VERSION, false );
52 -
53 84 if ( ! empty( Hostinger_Helper::get_api_token() ) ) {
54 - wp_enqueue_script( 'hostinger_requests_scripts', HOSTINGER_ASSETS_URL . '/js/requests.js', array(
55 - 'jquery',
56 - 'wp-i18n',
57 - ), HOSTINGER_VERSION, false );
58 - wp_localize_script( 'hostinger_requests_scripts', 'hostingerContainer', array(
59 - 'url' => admin_url( 'admin-ajax.php' ),
60 - 'nonce' => wp_create_nonce( 'hts-ajax-nonce' ),
61 - ) );
85 + wp_enqueue_script(
86 + 'hostinger_requests_scripts',
87 + HOSTINGER_ASSETS_URL . '/js/requests.js',
88 + array(
89 + 'jquery',
90 + 'wp-i18n',
91 + ),
92 + HOSTINGER_VERSION,
93 + false
94 + );
95 + wp_localize_script(
96 + 'hostinger_requests_scripts',
97 + 'hostingerContainer',
98 + array(
99 + 'url' => admin_url( 'admin-ajax.php' ),
100 + 'nonce' => wp_create_nonce( 'hts-ajax-nonce' ),
101 + )
102 + );
62 103 }
63 104 }
64 105 }
65 106