| @@ -104,12 +104,14 @@ | ||
| 104 | 104 | 'handle' => 'rtsb-frontend', |
| 105 | 105 | 'src' => rtsb()->get_assets_uri( 'css/frontend/frontend' . $rtl_suffix . '.css' ), |
| 106 | 106 | ]; |
| 107 | 107 | |
| 108 | + /* | |
| 108 | 109 | $this->styles[] = [ |
| 109 | 110 | 'handle' => 'swiper', |
| 110 | 111 | 'src' => rtsb()->get_assets_uri( 'vendor/swiper/css/swiper-bundle.min.css' ), |
| 111 | 112 | ]; |
| 113 | + */ | |
| 112 | 114 | |
| 113 | 115 | if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) { |
| 114 | 116 | $this->styles[] = [ |
| 115 | 117 | 'handle' => 'photoswipe', |
| @@ -269,8 +271,9 @@ | ||
| 269 | 271 | /** |
| 270 | 272 | * Register scripts. |
| 271 | 273 | */ |
| 272 | 274 | $this->register_public_scripts(); |
| 275 | + // wp_enqueue_style( 'swiper' ); | |
| 273 | 276 | /** |
| 274 | 277 | * Enqueue scripts. |
| 275 | 278 | */ |
| 276 | 279 | if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) { |
| @@ -276,9 +279,8 @@ | ||
| 276 | 279 | if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) { |
| 277 | 280 | /** |
| 278 | 281 | * Styles. |
| 279 | 282 | */ |
| 280 | - wp_enqueue_style( 'swiper' ); | |
| 281 | 283 | wp_enqueue_style( 'photoswipe' ); |
| 282 | 284 | wp_enqueue_style( 'photoswipe-default-skin' ); |
| 283 | 285 | wp_enqueue_style( 'elementor-editor-style-fix' ); |
| 284 | 286 | wp_enqueue_style( 'woocommerce-general' ); |
| @@ -396,8 +398,19 @@ | ||
| 396 | 398 | // wp_enqueue_style( 'rtsb-admin-global' ); |
| 397 | 399 | |
| 398 | 400 | global $pagenow; |
| 399 | 401 | |
| 402 | + $whitelisted_pages = [ 'rtsb-settings', 'rtsb-get-help', 'rtsb-themes' ]; | |
| 403 | + $current_page = ! empty( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 404 | + | |
| 405 | + if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && in_array( $current_page, $whitelisted_pages, true ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 406 | + /** | |
| 407 | + * Styles. | |
| 408 | + */ | |
| 409 | + wp_enqueue_style( 'rtsb-admin-app' ); | |
| 410 | + wp_enqueue_style( 'rtsb-fonts' ); | |
| 411 | + } | |
| 412 | + | |
| 400 | 413 | if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 401 | 414 | // Elementor Console Error Fixed For "rtsb-settings" Page. |
| 402 | 415 | wp_dequeue_script( 'elementor-admin-top-bar' ); |
| 403 | 416 | wp_dequeue_script( 'elementor-common' ); |
| @@ -413,14 +426,8 @@ | ||
| 413 | 426 | wp_dequeue_style( 'e-theme-ui-light' ); |
| 414 | 427 | wp_dequeue_style( 'elementor-common' ); |
| 415 | 428 | |
| 416 | 429 | /** |
| 417 | - * Styles. | |
| 418 | - */ | |
| 419 | - wp_enqueue_style( 'rtsb-admin-app' ); | |
| 420 | - wp_enqueue_style( 'rtsb-fonts' ); | |
| 421 | - | |
| 422 | - /** | |
| 423 | 430 | * Scripts. |
| 424 | 431 | */ |
| 425 | 432 | wp_enqueue_script( 'updates' ); |
| 426 | 433 | wp_enqueue_script( 'rtsb-admin-app' ); |
| @@ -433,12 +440,13 @@ | ||
| 433 | 440 | 'adminLogo' => rtsb()->get_assets_uri( 'images/icon/ShopBuilder-Logo.svg' ), |
| 434 | 441 | 'restApiUrl' => esc_url_raw( rest_url() ), |
| 435 | 442 | 'rest_nonce' => wp_create_nonce( 'wp_rest' ), |
| 436 | 443 | 'nonce' => wp_create_nonce( rtsb()->nonceText ), |
| 437 | - 'sections' => Settings::instance()->get_sections(), | |
| 438 | 444 | 'pages' => Fns::get_pages(), |
| 439 | 445 | 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', |
| 440 | 446 | 'updateRates' => esc_html__( 'Update All Rates', 'shopbuilder' ), |
| 447 | + 'sections' => Settings::instance()->get_sections(), | |
| 448 | + 'userRoles' => Fns::get_all_user_roles(), | |
| 441 | 449 | ] |
| 442 | 450 | ); |
| 443 | 451 | } else { |
| 444 | 452 | $current_screen = get_current_screen(); |