| @@ -86,9 +86,8 @@ | ||
| 86 | 86 | * |
| 87 | 87 | * @return object |
| 88 | 88 | */ |
| 89 | 89 | private function get_public_styles() { |
| 90 | - $rtl_suffix = is_rtl() ? '-rtl' : ''; | |
| 91 | 90 | $this->styles[] = [ |
| 92 | 91 | 'handle' => 'rtsb-fonts', |
| 93 | 92 | 'src' => rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ), |
| 94 | 93 | ]; |
| @@ -101,9 +100,9 @@ | ||
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | $this->styles[] = [ |
| 104 | 103 | 'handle' => 'rtsb-frontend', |
| 105 | - 'src' => rtsb()->get_assets_uri( 'css/frontend/frontend' . $rtl_suffix . '.css' ), | |
| 104 | + 'src' => rtsb()->get_assets_uri( 'css/frontend/frontend.css' ), | |
| 106 | 105 | ]; |
| 107 | 106 | |
| 108 | 107 | $this->styles[] = [ |
| 109 | 108 | 'handle' => 'swiper', |
| @@ -136,30 +135,11 @@ | ||
| 136 | 135 | * |
| 137 | 136 | * @return object |
| 138 | 137 | */ |
| 139 | 138 | private function get_public_scripts() { |
| 140 | - | |
| 141 | - $default_swiper_path = rtsb()->get_assets_uri( 'vendor/swiper/js/swiper-bundle.min.js' ); | |
| 142 | - | |
| 143 | - if ( defined( 'ELEMENTOR_ASSETS_PATH' ) ) { | |
| 144 | - $is_swiper8_enable = get_option( 'elementor_experiment-e_swiper_latest' ); | |
| 145 | - | |
| 146 | - if ( 'active' === $is_swiper8_enable || 'default' === $is_swiper8_enable ) { | |
| 147 | - $el_swiper_path = 'lib/swiper/v8/swiper.min.js'; | |
| 148 | - } else { | |
| 149 | - $el_swiper_path = 'lib/swiper/swiper.min.js'; | |
| 150 | - } | |
| 151 | - | |
| 152 | - $elementor_swiper_path = ELEMENTOR_ASSETS_PATH . $el_swiper_path; | |
| 153 | - | |
| 154 | - if ( file_exists( $elementor_swiper_path ) ) { | |
| 155 | - $default_swiper_path = ELEMENTOR_ASSETS_URL . $el_swiper_path; | |
| 156 | - } | |
| 157 | - } | |
| 158 | - | |
| 159 | 139 | $this->scripts[] = [ |
| 160 | 140 | 'handle' => 'swiper', |
| 161 | - 'src' => esc_url( $default_swiper_path ), | |
| 141 | + 'src' => rtsb()->get_assets_uri( 'vendor/swiper/js/swiper-bundle.min.js' ), | |
| 162 | 142 | 'deps' => [ 'jquery' ], |
| 163 | 143 | 'footer' => true, |
| 164 | 144 | ]; |
| 165 | 145 | |
| @@ -322,20 +302,18 @@ | ||
| 322 | 302 | wp_localize_script( |
| 323 | 303 | 'rtsb-public', |
| 324 | 304 | 'rtsbPublicParams', |
| 325 | 305 | [ |
| 326 | - 'ajaxUrl' => esc_url( self::$ajaxurl ), | |
| 327 | - 'homeurl' => home_url(), | |
| 328 | - 'wcCartUrl' => wc_get_cart_url(), | |
| 329 | - 'addedToCartText' => esc_html__( 'Product Added', 'shopbuilder' ), | |
| 330 | - 'singleCartToastrText' => esc_html__( 'Successfully Added', 'shopbuilder' ), | |
| 331 | - 'singleCartBtnText' => apply_filters( 'rtsb/global/single_add_to_cart_success', esc_html__( 'Added to Cart', 'shopbuilder' ) ), | |
| 332 | - 'browseCartText' => esc_html__( 'Browse Cart', 'shopbuilder' ), | |
| 333 | - 'noProductsText' => apply_filters( 'rtsb/global/no_products_text', esc_html__( 'No more products to load', 'shopbuilder' ) ), | |
| 334 | - 'notice' => [ | |
| 306 | + 'ajaxUrl' => esc_url( self::$ajaxurl ), | |
| 307 | + 'homeurl' => home_url(), | |
| 308 | + 'wcCartUrl' => wc_get_cart_url(), | |
| 309 | + 'addedToCartText' => esc_html__( 'Product Added', 'shopbuilder' ), | |
| 310 | + 'browseCartText' => esc_html__( 'Browse Cart', 'shopbuilder' ), | |
| 311 | + 'noProductsText' => apply_filters( 'rtsb/global/no_products_text', esc_html__( 'No more products to load', 'shopbuilder' ) ), | |
| 312 | + 'notice' => [ | |
| 335 | 313 | 'position' => Fns::get_option( 'general', 'notification', 'notification_position', 'center-center' ), |
| 336 | 314 | ], |
| 337 | - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 315 | + rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 338 | 316 | ] |
| 339 | 317 | ); |
| 340 | 318 | } |
| 341 | 319 | |
| @@ -348,10 +326,9 @@ | ||
| 348 | 326 | /** |
| 349 | 327 | * Styles. |
| 350 | 328 | */ |
| 351 | 329 | wp_register_style( 'rtsb-admin-app', rtsb()->get_assets_uri( 'css/backend/admin-settings.css' ), '', $this->version ); |
| 352 | - wp_register_style( 'rtsb-fonts', rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ), '', $this->version ); | |
| 353 | - // wp_register_style( 'rtsb-admin-global', rtsb()->get_assets_uri( 'css/backend/admin-global.css' ), '', $this->version ); | |
| 330 | + wp_register_style( 'rtsb-admin-global', rtsb()->get_assets_uri( 'css/backend/admin-global.css' ), '', $this->version ); | |
| 354 | 331 | wp_register_style( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'css/backend/template-builder.css' ), '', $this->version ); |
| 355 | 332 | |
| 356 | 333 | /** |
| 357 | 334 | * Scripts. |
| @@ -357,8 +334,9 @@ | ||
| 357 | 334 | * Scripts. |
| 358 | 335 | */ |
| 359 | 336 | wp_register_script( 'rtsb-admin-app', rtsb()->get_assets_uri( 'js/backend/admin-settings.js' ), '', $this->version, true ); |
| 360 | 337 | wp_register_script( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'js/backend/template-builder.js' ), '', $this->version, true ); |
| 338 | + | |
| 361 | 339 | } |
| 362 | 340 | |
| 363 | 341 | /** |
| 364 | 342 | * Enqueues admin scripts. |
| @@ -367,28 +345,14 @@ | ||
| 367 | 345 | * |
| 368 | 346 | * @return void |
| 369 | 347 | */ |
| 370 | 348 | public function enqueue_backend_scripts( $hook ) { |
| 371 | - ob_start(); ?> | |
| 372 | - #adminmenu .toplevel_page_rtsb .wp-menu-image img { | |
| 373 | - width: auto; | |
| 374 | - height: 22px; | |
| 375 | - padding: 4px 0; | |
| 376 | - } | |
| 377 | - .post-type-rtsb_builder li#wp-admin-bar-WPML_ALS_all, | |
| 378 | - .post-type-rtsb_builder li.language_all{ | |
| 379 | - display: none; | |
| 380 | - } | |
| 381 | 349 | |
| 382 | - <?php | |
| 383 | - $admin_global_style = ob_get_clean(); | |
| 384 | - // Speed Optimization. | |
| 385 | - wp_add_inline_style( 'admin-menu', $admin_global_style ); | |
| 386 | - // wp_enqueue_style( 'rtsb-admin-global' ); | |
| 350 | + wp_enqueue_style( 'rtsb-admin-global' ); | |
| 387 | 351 | |
| 388 | 352 | global $pagenow; |
| 389 | 353 | |
| 390 | - if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 354 | + if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { | |
| 391 | 355 | // Elementor Console Error Fixed For "rtsb-settings" Page. |
| 392 | 356 | wp_dequeue_script( 'elementor-admin-top-bar' ); |
| 393 | 357 | wp_dequeue_script( 'elementor-common' ); |
| 394 | 358 | wp_dequeue_script( 'elementor-dev-tools' ); |
| @@ -406,9 +370,8 @@ | ||
| 406 | 370 | /** |
| 407 | 371 | * Styles. |
| 408 | 372 | */ |
| 409 | 373 | wp_enqueue_style( 'rtsb-admin-app' ); |
| 410 | - wp_enqueue_style( 'rtsb-fonts' ); | |
| 411 | 374 | |
| 412 | 375 | /** |
| 413 | 376 | * Scripts. |
| 414 | 377 | */ |
| @@ -419,15 +382,14 @@ | ||
| 419 | 382 | 'rtsbParams', |
| 420 | 383 | [ |
| 421 | 384 | 'ajaxurl' => esc_url( self::$ajaxurl ), |
| 422 | 385 | 'homeurl' => home_url(), |
| 423 | - 'adminLogo' => rtsb()->get_assets_uri( 'images/icon/ShopBuilder-Logo.svg' ), | |
| 424 | 386 | 'restApiUrl' => esc_url_raw( rest_url() ), |
| 425 | 387 | 'rest_nonce' => wp_create_nonce( 'wp_rest' ), |
| 426 | 388 | 'nonce' => wp_create_nonce( rtsb()->nonceText ), |
| 427 | 389 | 'sections' => Settings::instance()->get_sections(), |
| 428 | 390 | 'pages' => Fns::get_pages(), |
| 429 | - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', | |
| 391 | + 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no' | |
| 430 | 392 | ] |
| 431 | 393 | ); |
| 432 | 394 | } else { |
| 433 | 395 | $current_screen = get_current_screen(); |
| @@ -440,9 +402,9 @@ | ||
| 440 | 402 | * Styles. |
| 441 | 403 | */ |
| 442 | 404 | wp_enqueue_style( 'rtsb-templatebuilder' ); |
| 443 | 405 | |
| 444 | - wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion | |
| 406 | + wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); | |
| 445 | 407 | |
| 446 | 408 | wp_enqueue_script( 'selectWoo' ); |
| 447 | 409 | /** |
| 448 | 410 | * Scripts. |
| @@ -455,9 +417,9 @@ | ||
| 455 | 417 | [ |
| 456 | 418 | 'ajaxurl' => esc_url( self::$ajaxurl ), |
| 457 | 419 | 'homeurl' => home_url(), |
| 458 | 420 | rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), |
| 459 | - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', | |
| 421 | + 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no' | |
| 460 | 422 | ] |
| 461 | 423 | ); |
| 462 | 424 | } |
| 463 | 425 | } |