| @@ -396,8 +396,19 @@ | ||
| 396 | 396 | // wp_enqueue_style( 'rtsb-admin-global' ); |
| 397 | 397 | |
| 398 | 398 | global $pagenow; |
| 399 | 399 | |
| 400 | + $whitelisted_pages = [ 'rtsb-settings', 'rtsb-get-help', 'rtsb-themes' ]; | |
| 401 | + $current_page = ! empty( $_GET['page'] ) ? sanitize_text_field( wp_unslash( $_GET['page'] ) ) : ''; // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 402 | + | |
| 403 | + if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && in_array( $current_page, $whitelisted_pages, true ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended | |
| 404 | + /** | |
| 405 | + * Styles. | |
| 406 | + */ | |
| 407 | + wp_enqueue_style( 'rtsb-admin-app' ); | |
| 408 | + wp_enqueue_style( 'rtsb-fonts' ); | |
| 409 | + } | |
| 410 | + | |
| 400 | 411 | if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 401 | 412 | // Elementor Console Error Fixed For "rtsb-settings" Page. |
| 402 | 413 | wp_dequeue_script( 'elementor-admin-top-bar' ); |
| 403 | 414 | wp_dequeue_script( 'elementor-common' ); |
| @@ -413,14 +424,8 @@ | ||
| 413 | 424 | wp_dequeue_style( 'e-theme-ui-light' ); |
| 414 | 425 | wp_dequeue_style( 'elementor-common' ); |
| 415 | 426 | |
| 416 | 427 | /** |
| 417 | - * Styles. | |
| 418 | - */ | |
| 419 | - wp_enqueue_style( 'rtsb-admin-app' ); | |
| 420 | - wp_enqueue_style( 'rtsb-fonts' ); | |
| 421 | - | |
| 422 | - /** | |
| 423 | 428 | * Scripts. |
| 424 | 429 | */ |
| 425 | 430 | wp_enqueue_script( 'updates' ); |
| 426 | 431 | wp_enqueue_script( 'rtsb-admin-app' ); |
| @@ -433,12 +438,13 @@ | ||
| 433 | 438 | 'adminLogo' => rtsb()->get_assets_uri( 'images/icon/ShopBuilder-Logo.svg' ), |
| 434 | 439 | 'restApiUrl' => esc_url_raw( rest_url() ), |
| 435 | 440 | 'rest_nonce' => wp_create_nonce( 'wp_rest' ), |
| 436 | 441 | 'nonce' => wp_create_nonce( rtsb()->nonceText ), |
| 437 | - 'sections' => Settings::instance()->get_sections(), | |
| 438 | 442 | 'pages' => Fns::get_pages(), |
| 439 | 443 | 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', |
| 440 | 444 | 'updateRates' => esc_html__( 'Update All Rates', 'shopbuilder' ), |
| 445 | + 'sections' => Settings::instance()->get_sections(), | |
| 446 | + 'userRoles' => Fns::get_all_user_roles(), | |
| 441 | 447 | ] |
| 442 | 448 | ); |
| 443 | 449 | } else { |
| 444 | 450 | $current_screen = get_current_screen(); |