| @@ -322,8 +322,9 @@ | ||
| 322 | 322 | $context_scripts, |
| 323 | 323 | $this->enabled_modules, |
| 324 | 324 | $this->enabled_widgets |
| 325 | 325 | ); |
| 326 | + | |
| 326 | 327 | return apply_filters( 'rtsb/optimizer/scripts', $context_scripts ); |
| 327 | 328 | } |
| 328 | 329 | |
| 329 | 330 | /** |
| @@ -969,14 +970,8 @@ | ||
| 969 | 970 | $module_list = Fns::get_modules_list(); |
| 970 | 971 | $enabled = []; |
| 971 | 972 | |
| 972 | 973 | foreach ( $module_list as $slug => $info ) { |
| 973 | - if ( defined( 'RTWPVG_VERSION' ) && 'variation_gallery' === $slug ) { | |
| 974 | - continue; | |
| 975 | - } | |
| 976 | - if ( defined( 'RTWPVS_VERSION' ) && 'variation_swatches' === $slug ) { | |
| 977 | - continue; | |
| 978 | - } | |
| 979 | 974 | if ( ! empty( $info['active'] ) ) { |
| 980 | 975 | $enabled[] = str_replace( '_', '-', sanitize_key( $slug ) ); |
| 981 | 976 | } |
| 982 | 977 | } |
| @@ -1000,14 +995,8 @@ | ||
| 1000 | 995 | ] |
| 1001 | 996 | ); |
| 1002 | 997 | |
| 1003 | 998 | foreach ( $module_list as $slug => $info ) { |
| 1004 | - if ( defined( 'RTWPVG_VERSION' ) && 'variation_gallery' === $slug ) { | |
| 1005 | - continue; | |
| 1006 | - } | |
| 1007 | - if ( defined( 'RTWPVS_VERSION' ) && 'variation_swatches' === $slug ) { | |
| 1008 | - continue; | |
| 1009 | - } | |
| 1010 | 999 | $clean_slug = str_replace( '_', '-', sanitize_key( $slug ) ); |
| 1011 | 1000 | $is_enabled = isset( $info['active'] ) && 'on' === $info['active']; |
| 1012 | 1001 | |
| 1013 | 1002 | $modules[ $clean_slug ] = [ |
| @@ -1035,14 +1024,8 @@ | ||
| 1035 | 1024 | ] |
| 1036 | 1025 | ); |
| 1037 | 1026 | |
| 1038 | 1027 | foreach ( $module_list as $slug => $info ) { |
| 1039 | - if ( defined( 'RTWPVG_VERSION' ) && 'variation_gallery' === $slug ) { | |
| 1040 | - continue; | |
| 1041 | - } | |
| 1042 | - if ( defined( 'RTWPVS_VERSION' ) && 'variation_swatches' === $slug ) { | |
| 1043 | - continue; | |
| 1044 | - } | |
| 1045 | 1028 | $clean_slug = str_replace( '_', '-', sanitize_key( $slug ) ); |
| 1046 | 1029 | $is_enabled = isset( $info['active'] ) && 'on' === $info['active']; |
| 1047 | 1030 | |
| 1048 | 1031 | $modules[ $clean_slug ] = [ |
| @@ -1150,14 +1133,17 @@ | ||
| 1150 | 1133 | |
| 1151 | 1134 | if ( $this->contextual_loading ) { |
| 1152 | 1135 | if ( 'js' === $type && ! empty( $bundled['js'] ) ) { |
| 1153 | 1136 | $ctx = isset( $bundled['js'][ $context ] ) ? $context : 'global'; |
| 1137 | + | |
| 1154 | 1138 | if ( $ctx ) { |
| 1155 | 1139 | $assets = (array) $bundled['js'][ $ctx ]; |
| 1156 | 1140 | } |
| 1157 | 1141 | } |
| 1142 | + | |
| 1158 | 1143 | if ( 'css' === $type && ! empty( $bundled['css'] ) ) { |
| 1159 | 1144 | $ctx = isset( $bundled['css'][ $context ] ) ? $context : 'global'; |
| 1145 | + | |
| 1160 | 1146 | if ( $ctx ) { |
| 1161 | 1147 | $assets = (array) $bundled['css'][ $ctx ]; |
| 1162 | 1148 | } |
| 1163 | 1149 | } |