| 1 |
<?php |
| 2 |
|
| 3 |
namespace RadiusTheme\SB\Controllers; |
| 4 |
|
| 5 |
use RadiusTheme\SB\Helpers\BuilderFns; |
| 6 |
use RadiusTheme\SB\Helpers\Fns; |
| 7 |
use RadiusTheme\SB\Models\Settings; |
| 8 |
use RadiusTheme\SB\Traits\SingletonTrait; |
| 9 |
|
| 10 |
// Do not allow directly accessing this file. |
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit( 'This script cannot be accessed directly.' ); |
| 13 |
} |
| 14 |
|
| 15 |
class AssetsController { |
| 16 |
|
| 17 |
use SingletonTrait; |
| 18 |
|
| 19 |
/** |
| 20 |
* Plugin version |
| 21 |
* |
| 22 |
* @var string |
| 23 |
*/ |
| 24 |
private $version; |
| 25 |
|
| 26 |
/** |
| 27 |
* Ajax URL |
| 28 |
* |
| 29 |
* @var string |
| 30 |
*/ |
| 31 |
private static $ajaxurl; |
| 32 |
|
| 33 |
/** |
| 34 |
* Styles. |
| 35 |
* |
| 36 |
* @var array |
| 37 |
*/ |
| 38 |
private $styles = []; |
| 39 |
|
| 40 |
/** |
| 41 |
* Scripts. |
| 42 |
* |
| 43 |
* @var array |
| 44 |
*/ |
| 45 |
private $scripts = []; |
| 46 |
|
| 47 |
/** |
| 48 |
* Class Constructor |
| 49 |
*/ |
| 50 |
public function __construct() { |
| 51 |
$this->version = ( defined( 'WP_DEBUG' ) && WP_DEBUG ) ? time() : RTSB_VERSION; |
| 52 |
|
| 53 |
if ( in_array( 'sitepress-multilingual-cms/sitepress.php', get_option( 'active_plugins' ) ) ) { |
| 54 |
self::$ajaxurl = admin_url( 'admin-ajax.php?lang=' . ICL_LANGUAGE_CODE ); |
| 55 |
} else { |
| 56 |
self::$ajaxurl = admin_url( 'admin-ajax.php' ); |
| 57 |
} |
| 58 |
|
| 59 |
/** |
| 60 |
* Admin scripts. |
| 61 |
*/ |
| 62 |
add_action( 'admin_enqueue_scripts', [ $this, 'register_backend_assets' ], 1 ); |
| 63 |
add_action( 'admin_enqueue_scripts', [ $this, 'enqueue_backend_scripts' ], 15 ); |
| 64 |
|
| 65 |
/** |
| 66 |
* Public scripts. |
| 67 |
*/ |
| 68 |
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_public_scripts' ], 15 ); |
| 69 |
/** |
| 70 |
* General scripts. |
| 71 |
*/ |
| 72 |
add_action( 'wp_enqueue_scripts', [ $this, 'enqueue_general_public_scripts' ], 30 ); |
| 73 |
} |
| 74 |
|
| 75 |
/** |
| 76 |
* Get all frontend scripts. |
| 77 |
* |
| 78 |
* @return void |
| 79 |
*/ |
| 80 |
private function get_public_assets() { |
| 81 |
$this->get_public_styles()->get_public_scripts(); |
| 82 |
} |
| 83 |
|
| 84 |
/** |
| 85 |
* Get public styles. |
| 86 |
* |
| 87 |
* @return object |
| 88 |
*/ |
| 89 |
private function get_public_styles() { |
| 90 |
$rtl_suffix = is_rtl() ? '-rtl' : ''; |
| 91 |
$this->styles[] = [ |
| 92 |
'handle' => 'rtsb-fonts', |
| 93 |
'src' => rtsb()->get_assets_uri( 'css/frontend/rtsb-fonts.css' ), |
| 94 |
]; |
| 95 |
|
| 96 |
if ( rtsb()->has_pro() ) { |
| 97 |
$this->styles[] = [ |
| 98 |
'handle' => 'rtsb-noui-slider', |
| 99 |
'src' => rtsbpro()->get_assets_uri( 'vendors/nouislider/nouislider.min.css' ), |
| 100 |
]; |
| 101 |
} |
| 102 |
|
| 103 |
$this->styles[] = [ |
| 104 |
'handle' => 'rtsb-frontend', |
| 105 |
'src' => rtsb()->get_assets_uri( 'css/frontend/frontend' . $rtl_suffix . '.css' ), |
| 106 |
]; |
| 107 |
|
| 108 |
$this->styles[] = [ |
| 109 |
'handle' => 'swiper', |
| 110 |
'src' => rtsb()->get_assets_uri( 'vendor/swiper/css/swiper-bundle.min.css' ), |
| 111 |
]; |
| 112 |
|
| 113 |
if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) { |
| 114 |
$this->styles[] = [ |
| 115 |
'handle' => 'photoswipe', |
| 116 |
'src' => plugins_url( 'assets/css/photoswipe/photoswipe.min.css', WC_PLUGIN_FILE ), |
| 117 |
]; |
| 118 |
|
| 119 |
$this->styles[] = [ |
| 120 |
'handle' => 'photoswipe-default-skin', |
| 121 |
'src' => plugins_url( 'assets/css/photoswipe/default-skin/default-skin.min.css', WC_PLUGIN_FILE ), |
| 122 |
]; |
| 123 |
|
| 124 |
// Load only for elementor editor page and fix some issue. |
| 125 |
$this->styles[] = [ |
| 126 |
'handle' => 'elementor-editor-style-fix', |
| 127 |
'src' => rtsb()->get_assets_uri( 'css/backend/elementor-editor-style-fix.css' ), |
| 128 |
]; |
| 129 |
} |
| 130 |
|
| 131 |
return $this; |
| 132 |
} |
| 133 |
|
| 134 |
/** |
| 135 |
* Get public scripts. |
| 136 |
* |
| 137 |
* @return object |
| 138 |
*/ |
| 139 |
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 |
$this->scripts[] = [ |
| 160 |
'handle' => 'swiper', |
| 161 |
'src' => esc_url( $default_swiper_path ), |
| 162 |
'deps' => [ 'jquery' ], |
| 163 |
'footer' => true, |
| 164 |
]; |
| 165 |
|
| 166 |
$this->scripts[] = [ |
| 167 |
'handle' => 'rtsb-imagesloaded', |
| 168 |
'src' => rtsb()->get_assets_uri( 'vendor/isotope/imagesloaded.pkgd.min.js' ), |
| 169 |
'deps' => [ 'jquery' ], |
| 170 |
'footer' => true, |
| 171 |
]; |
| 172 |
|
| 173 |
$this->scripts[] = [ |
| 174 |
'handle' => 'rtsb-tipsy', |
| 175 |
'src' => rtsb()->get_assets_uri( 'vendor/tipsy/tipsy.min.js' ), |
| 176 |
'deps' => [ 'jquery' ], |
| 177 |
'footer' => true, |
| 178 |
]; |
| 179 |
|
| 180 |
if ( BuilderFns::is_builder_preview() && 'elementor' == Fns::page_edit_with( get_the_ID() ) ) { |
| 181 |
$this->scripts[] = [ |
| 182 |
'handle' => 'flexslider', |
| 183 |
'src' => plugins_url( 'assets/js/flexslider/jquery.flexslider.js', WC_PLUGIN_FILE ), |
| 184 |
'deps' => [ 'jquery' ], |
| 185 |
'footer' => true, |
| 186 |
]; |
| 187 |
|
| 188 |
$this->scripts[] = [ |
| 189 |
'handle' => 'photoswipe', |
| 190 |
'src' => plugins_url( 'assets/js/photoswipe/photoswipe.js', WC_PLUGIN_FILE ), |
| 191 |
'deps' => [ 'jquery' ], |
| 192 |
'footer' => true, |
| 193 |
]; |
| 194 |
|
| 195 |
$this->scripts[] = [ |
| 196 |
'handle' => 'zoom', |
| 197 |
'src' => plugins_url( 'assets/js/zoom/jquery.zoom.js', WC_PLUGIN_FILE ), |
| 198 |
'deps' => [ 'jquery' ], |
| 199 |
'footer' => true, |
| 200 |
]; |
| 201 |
|
| 202 |
$this->scripts[] = [ |
| 203 |
'handle' => 'photoswipe-ui-default', |
| 204 |
'src' => plugins_url( 'assets/js/photoswipe/photoswipe-ui-default.js', WC_PLUGIN_FILE ), |
| 205 |
'deps' => [ 'jquery', 'photoswipe' ], |
| 206 |
'footer' => true, |
| 207 |
]; |
| 208 |
|
| 209 |
$this->scripts[] = [ |
| 210 |
'handle' => 'wc-single-product', |
| 211 |
'src' => plugins_url( 'assets/js/frontend/single-product.js', WC_PLUGIN_FILE ), |
| 212 |
'deps' => [ 'jquery', 'flexslider', 'photoswipe', 'photoswipe-ui-default', 'zoom' ], |
| 213 |
'footer' => true, |
| 214 |
]; |
| 215 |
|
| 216 |
} |
| 217 |
|
| 218 |
if ( rtsb()->has_pro() ) { |
| 219 |
$this->scripts[] = [ |
| 220 |
'handle' => 'rtsb-noui-slider', |
| 221 |
'src' => rtsbpro()->get_assets_uri( 'vendors/nouislider/nouislider.min.js' ), |
| 222 |
'deps' => [ 'jquery' ], |
| 223 |
'footer' => true, |
| 224 |
]; |
| 225 |
|
| 226 |
$this->scripts[] = [ |
| 227 |
'handle' => 'rtsb-sticky-sidebar', |
| 228 |
'src' => rtsbpro()->get_assets_uri( 'vendors/sticky-sidebar/sticky-sidebar.min.js' ), |
| 229 |
'deps' => [ 'jquery' ], |
| 230 |
'footer' => true, |
| 231 |
]; |
| 232 |
} |
| 233 |
|
| 234 |
$this->scripts[] = [ |
| 235 |
'handle' => 'rtsb-public', |
| 236 |
'src' => rtsb()->get_assets_uri( 'js/frontend/frontend.js' ), |
| 237 |
'deps' => [ 'jquery', 'rtsb-imagesloaded', 'swiper' ], |
| 238 |
'footer' => true, |
| 239 |
]; |
| 240 |
|
| 241 |
return $this; |
| 242 |
} |
| 243 |
|
| 244 |
/** |
| 245 |
* Register public scripts. |
| 246 |
* |
| 247 |
* @return void |
| 248 |
*/ |
| 249 |
public function register_public_scripts() { |
| 250 |
$this->get_public_assets(); |
| 251 |
|
| 252 |
// Register public styles. |
| 253 |
foreach ( $this->styles as $style ) { |
| 254 |
wp_register_style( $style['handle'], $style['src'], '', $this->version ); |
| 255 |
} |
| 256 |
|
| 257 |
// Register public scripts. |
| 258 |
foreach ( $this->scripts as $script ) { |
| 259 |
wp_register_script( $script['handle'], $script['src'], $script['deps'], $this->version, $script['footer'] ); |
| 260 |
} |
| 261 |
} |
| 262 |
|
| 263 |
/** |
| 264 |
* Enqueues public scripts. |
| 265 |
* |
| 266 |
* @return void |
| 267 |
*/ |
| 268 |
public function enqueue_public_scripts() { |
| 269 |
/** |
| 270 |
* Register scripts. |
| 271 |
*/ |
| 272 |
$this->register_public_scripts(); |
| 273 |
/** |
| 274 |
* Enqueue scripts. |
| 275 |
*/ |
| 276 |
if ( BuilderFns::is_builder_preview() && 'elementor' === Fns::page_edit_with( get_the_ID() ) ) { |
| 277 |
/** |
| 278 |
* Styles. |
| 279 |
*/ |
| 280 |
wp_enqueue_style( 'swiper' ); |
| 281 |
wp_enqueue_style( 'photoswipe' ); |
| 282 |
wp_enqueue_style( 'photoswipe-default-skin' ); |
| 283 |
wp_enqueue_style( 'elementor-editor-style-fix' ); |
| 284 |
wp_enqueue_style( 'woocommerce-general' ); |
| 285 |
|
| 286 |
/** |
| 287 |
* Scripts. |
| 288 |
*/ |
| 289 |
wp_enqueue_script( 'flexslider' ); |
| 290 |
wp_enqueue_script( 'wc-single-product' ); |
| 291 |
wp_dequeue_script( 'rtsb-public' ); |
| 292 |
wp_enqueue_script( 'swiper' ); |
| 293 |
wp_enqueue_script( 'rtsb-public' ); |
| 294 |
} |
| 295 |
|
| 296 |
/** |
| 297 |
* Styles. |
| 298 |
*/ |
| 299 |
wp_enqueue_style( 'rtsb-fonts' ); |
| 300 |
wp_enqueue_style( 'rtsb-frontend' ); |
| 301 |
|
| 302 |
/** |
| 303 |
* Scripts. |
| 304 |
*/ |
| 305 |
wp_enqueue_script( 'rtsb-imagesloaded' ); |
| 306 |
wp_enqueue_script( 'rtsb-tipsy' ); |
| 307 |
wp_enqueue_script( 'rtsb-public' ); |
| 308 |
|
| 309 |
/** |
| 310 |
* Localize script. |
| 311 |
*/ |
| 312 |
self::localizeData(); |
| 313 |
} |
| 314 |
|
| 315 |
/** |
| 316 |
* Localized Data. |
| 317 |
* |
| 318 |
* @static |
| 319 |
* @return void |
| 320 |
*/ |
| 321 |
public static function localizeData() { |
| 322 |
wp_localize_script( |
| 323 |
'rtsb-public', |
| 324 |
'rtsbPublicParams', |
| 325 |
[ |
| 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' => [ |
| 335 |
'position' => Fns::get_option( 'general', 'notification', 'notification_position', 'center-center' ), |
| 336 |
], |
| 337 |
rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), |
| 338 |
] |
| 339 |
); |
| 340 |
} |
| 341 |
|
| 342 |
/** |
| 343 |
* Registers Admin scripts. |
| 344 |
* |
| 345 |
* @return void |
| 346 |
*/ |
| 347 |
public function register_backend_assets() { |
| 348 |
/** |
| 349 |
* Styles. |
| 350 |
*/ |
| 351 |
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 ); |
| 354 |
wp_register_style( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'css/backend/template-builder.css' ), '', $this->version ); |
| 355 |
|
| 356 |
/** |
| 357 |
* Scripts. |
| 358 |
*/ |
| 359 |
wp_register_script( 'rtsb-admin-app', rtsb()->get_assets_uri( 'js/backend/admin-settings.js' ), '', $this->version, true ); |
| 360 |
wp_register_script( 'rtsb-templatebuilder', rtsb()->get_assets_uri( 'js/backend/template-builder.js' ), '', $this->version, true ); |
| 361 |
} |
| 362 |
|
| 363 |
/** |
| 364 |
* Enqueues admin scripts. |
| 365 |
* |
| 366 |
* @param string $hook Hooks. |
| 367 |
* |
| 368 |
* @return void |
| 369 |
*/ |
| 370 |
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 |
|
| 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' ); |
| 387 |
|
| 388 |
global $pagenow; |
| 389 |
|
| 390 |
if ( 'admin.php' === $pagenow && ! empty( $_GET['page'] ) && 'rtsb-settings' === $_GET['page'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended |
| 391 |
// Elementor Console Error Fixed For "rtsb-settings" Page. |
| 392 |
wp_dequeue_script( 'elementor-admin-top-bar' ); |
| 393 |
wp_dequeue_script( 'elementor-common' ); |
| 394 |
wp_dequeue_script( 'elementor-dev-tools' ); |
| 395 |
wp_dequeue_script( 'elementor-web-cli' ); |
| 396 |
wp_dequeue_script( 'elementor-import-export-admin' ); |
| 397 |
wp_dequeue_script( 'elementor-app-loader' ); |
| 398 |
wp_dequeue_script( 'elementor-admin-modules' ); |
| 399 |
wp_dequeue_script( 'elementor-admin' ); |
| 400 |
|
| 401 |
wp_dequeue_style( 'elementor-admin-top-bar' ); |
| 402 |
wp_dequeue_style( 'elementor-admin' ); |
| 403 |
wp_dequeue_style( 'e-theme-ui-light' ); |
| 404 |
wp_dequeue_style( 'elementor-common' ); |
| 405 |
|
| 406 |
/** |
| 407 |
* Styles. |
| 408 |
*/ |
| 409 |
wp_enqueue_style( 'rtsb-admin-app' ); |
| 410 |
wp_enqueue_style( 'rtsb-fonts' ); |
| 411 |
|
| 412 |
/** |
| 413 |
* Scripts. |
| 414 |
*/ |
| 415 |
wp_enqueue_script( 'updates' ); |
| 416 |
wp_enqueue_script( 'rtsb-admin-app' ); |
| 417 |
wp_localize_script( |
| 418 |
'rtsb-admin-app', |
| 419 |
'rtsbParams', |
| 420 |
[ |
| 421 |
'ajaxurl' => esc_url( self::$ajaxurl ), |
| 422 |
'homeurl' => home_url(), |
| 423 |
'adminLogo' => rtsb()->get_assets_uri( 'images/icon/ShopBuilder-Logo.svg' ), |
| 424 |
'restApiUrl' => esc_url_raw( rest_url() ), |
| 425 |
'rest_nonce' => wp_create_nonce( 'wp_rest' ), |
| 426 |
'nonce' => wp_create_nonce( rtsb()->nonceText ), |
| 427 |
'sections' => Settings::instance()->get_sections(), |
| 428 |
'pages' => Fns::get_pages(), |
| 429 |
'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', |
| 430 |
'updateRates' => esc_html__( 'Update All Rates', 'shopbuilder' ), |
| 431 |
] |
| 432 |
|
| 433 |
); |
| 434 |
} else { |
| 435 |
$current_screen = get_current_screen(); |
| 436 |
|
| 437 |
if ( 'edit-rtsb_builder' === $current_screen->id ) { |
| 438 |
if ( ! function_exists( 'woocommerce_get_asset_url' ) ) { |
| 439 |
include_once WC_ABSPATH . 'includes/wc-template-functions.php'; |
| 440 |
} |
| 441 |
/** |
| 442 |
* Styles. |
| 443 |
*/ |
| 444 |
wp_enqueue_style( 'rtsb-templatebuilder' ); |
| 445 |
|
| 446 |
wp_enqueue_style( 'select2', plugins_url( 'assets/css/select2.css', WC_PLUGIN_FILE ) ); // phpcs:ignore WordPress.WP.EnqueuedResourceParameters.MissingVersion |
| 447 |
|
| 448 |
wp_enqueue_script( 'selectWoo' ); |
| 449 |
/** |
| 450 |
* Scripts. |
| 451 |
*/ |
| 452 |
wp_enqueue_script( 'rtsb-templatebuilder' ); |
| 453 |
|
| 454 |
wp_localize_script( |
| 455 |
'rtsb-templatebuilder', |
| 456 |
'rtsbParams', |
| 457 |
[ |
| 458 |
'ajaxurl' => esc_url( self::$ajaxurl ), |
| 459 |
'homeurl' => home_url(), |
| 460 |
rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), |
| 461 |
'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', |
| 462 |
] |
| 463 |
); |
| 464 |
} |
| 465 |
} |
| 466 |
} |
| 467 |
|
| 468 |
/** |
| 469 |
* Enqueues general public scripts. |
| 470 |
* |
| 471 |
* @return void |
| 472 |
*/ |
| 473 |
public function enqueue_general_public_scripts() { |
| 474 |
$notification_color = Fns::get_option( 'general', 'notification', 'notification_color', '#004BFF' ); |
| 475 |
$notification_bgcolor = Fns::get_option( 'general', 'notification', 'notification_bg', '#F5F8FF' ); |
| 476 |
$notification_button_color = Fns::get_option( 'general', 'notification', 'notification_btn_color', '#0039C0' ); |
| 477 |
|
| 478 |
$dynamic_css = ''; |
| 479 |
|
| 480 |
if ( ! empty( $notification_color ) ) { |
| 481 |
$dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success{color:{$notification_color}}"; |
| 482 |
$dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success:before{background-color:{$notification_color}}"; |
| 483 |
} |
| 484 |
|
| 485 |
if ( ! empty( $notification_bgcolor ) ) { |
| 486 |
$dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success{background-color:{$notification_bgcolor}}"; |
| 487 |
} |
| 488 |
|
| 489 |
if ( ! empty( $notification_button_color ) ) { |
| 490 |
$dynamic_css .= ".rtsb-shopbuilder-plugin #toast-container .toast-success a{color:{$notification_button_color}}"; |
| 491 |
} |
| 492 |
|
| 493 |
if ( ! empty( $dynamic_css ) ) { |
| 494 |
wp_add_inline_style( 'rtsb-frontend', $dynamic_css ); |
| 495 |
} |
| 496 |
} |
| 497 |
} |
| 498 |
|