| @@ -137,18 +137,10 @@ | ||
| 137 | 137 | |
| 138 | 138 | $pro_version = defined( 'RTSBPRO_VERSION' ) ? RTSBPRO_VERSION : '0'; |
| 139 | 139 | $addon_condition = version_compare( $pro_version, '1.9.0', '<' ); |
| 140 | 140 | |
| 141 | - $optimized = []; | |
| 142 | - | |
| 143 | 141 | if ( ! rtsb()->has_pro() && Fns::is_optimization_enabled() ) { |
| 144 | - $optimized = AssetRegistry::instance()->load_optimized_assets(); | |
| 145 | - } | |
| 146 | - | |
| 147 | - // An empty `src` means the bundle could not be built. Registering it would | |
| 148 | - // produce a handle WordPress never prints, so use the unbundled assets. | |
| 149 | - if ( ! empty( $optimized['src'] ) ) { | |
| 150 | - $this->styles[] = $optimized; | |
| 142 | + $this->styles[] = AssetRegistry::instance()->load_optimized_assets(); | |
| 151 | 143 | } else { |
| 152 | 144 | if ( $addon_condition ) { |
| 153 | 145 | $this->styles[] = [ |
| 154 | 146 | 'handle' => 'rtsb-general-addons', |
| @@ -280,17 +272,10 @@ | ||
| 280 | 272 | 'footer' => true, |
| 281 | 273 | ]; |
| 282 | 274 | } |
| 283 | 275 | |
| 284 | - $optimized = []; | |
| 285 | - | |
| 286 | 276 | if ( ! rtsb()->has_pro() && Fns::is_optimization_enabled() ) { |
| 287 | - $optimized = AssetRegistry::instance()->load_optimized_assets( 'js' ); | |
| 288 | - } | |
| 289 | - | |
| 290 | - // See get_public_styles(): an empty `src` means the bundle build failed. | |
| 291 | - if ( ! empty( $optimized['src'] ) ) { | |
| 292 | - $this->scripts[] = $optimized; | |
| 277 | + $this->scripts[] = AssetRegistry::instance()->load_optimized_assets( 'js' ); | |
| 293 | 278 | } else { |
| 294 | 279 | $this->scripts[] = [ |
| 295 | 280 | 'handle' => 'rtsb-public', |
| 296 | 281 | 'src' => rtsb()->get_assets_uri( 'js/frontend/frontend.js' ), |
| @@ -394,9 +379,8 @@ | ||
| 394 | 379 | [ |
| 395 | 380 | 'ajaxUrl' => esc_url( self::$ajaxurl ), |
| 396 | 381 | 'aiActivated' => ! empty( $ai_data ), |
| 397 | 382 | 'homeurl' => home_url(), |
| 398 | - 'shopUrl' => function_exists( 'wc_get_page_permalink' ) ? esc_url( wc_get_page_permalink( 'shop' ) ) : home_url( '/' ), | |
| 399 | 383 | 'wcCartUrl' => wc_get_cart_url(), |
| 400 | 384 | 'addedToCartText' => esc_html__( 'Product Added', 'shopbuilder' ), |
| 401 | 385 | 'singleCartToastrText' => esc_html__( 'Successfully Added', 'shopbuilder' ), |
| 402 | 386 | 'singleCartBtnText' => apply_filters( 'rtsb/global/single_add_to_cart_success', esc_html__( 'Added to Cart', 'shopbuilder' ) ), |
| @@ -564,16 +548,12 @@ | ||
| 564 | 548 | wp_localize_script( |
| 565 | 549 | 'rtsb-templatebuilder', |
| 566 | 550 | 'rtsbParams', |
| 567 | 551 | [ |
| 568 | - 'ajaxurl' => esc_url( self::$ajaxurl ), | |
| 569 | - 'homeurl' => home_url(), | |
| 570 | - rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 571 | - 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', | |
| 572 | - 'singletonTypes' => apply_filters( | |
| 573 | - 'rtsb/builder/singleton_types', | |
| 574 | - array_keys( \RadiusTheme\SB\Helpers\BuilderFns::builder_page_types() ) | |
| 575 | - ), | |
| 552 | + 'ajaxurl' => esc_url( self::$ajaxurl ), | |
| 553 | + 'homeurl' => home_url(), | |
| 554 | + rtsb()->nonceId => wp_create_nonce( rtsb()->nonceText ), | |
| 555 | + 'hasPro' => rtsb()->has_pro() ? 'yes' : 'no', | |
| 576 | 556 | ] |
| 577 | 557 | ); |
| 578 | 558 | } |
| 579 | 559 | } |