Ticket #48154: 48514-warnings.diff
File 48514-warnings.diff, 1.5 KB (added by , 5 years ago) |
---|
-
src/wp-includes/script-loader.php
288 288 ); 289 289 290 290 foreach ( $packages as $package ) { 291 $handle = 'wp-' . $package; 292 $path = "/wp-includes/js/dist/$package$suffix.js"; 291 $handle = 'wp-' . $package; 292 $js_path = "/wp-includes/js/dist/$package$suffix.js"; 293 $dependencies = array(); 294 $version = false; 293 295 294 if ( ! file_exists( ABSPATH . $path ) ) { 295 continue; 296 $asset_path = ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php"; 297 if ( file_exists( $asset_path ) ) { 298 $asset_file = include $asset_path; 299 $dependencies = $asset_file['dependencies']; 300 $version = $asset_file['version']; 296 301 } 297 302 298 $asset_file = include ABSPATH . WPINC . "/assets/dist/$package$suffix.asset.php";299 $dependencies = $asset_file['dependencies'];300 301 303 // Add dependencies that cannot be detected and generated by build tools. 302 304 switch ( $handle ) { 303 305 case 'wp-block-library': … … 307 309 array_push( $dependencies, 'media-models', 'media-views', 'postbox', 'wp-dom-ready' ); 308 310 break; 309 311 } 312 $scripts->add( $handle, $js_path, $dependencies, $version, 1 ); 310 313 311 $scripts->add( $handle, $path, $dependencies, $asset_file['version'], 1 );312 313 314 if ( in_array( $package, $package_translations, true ) ) { 314 315 $scripts->set_translations( $handle ); 315 316 }