Changeset 60948 for trunk/src/wp-includes/class-wp-scripts.php
- Timestamp:
- 10/16/2025 07:59:11 PM (4 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-scripts.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-scripts.php
r60931 r60948 293 293 294 294 $obj = $this->registered[ $handle ]; 295 if ( $obj->extra['conditional'] ?? false ) { 296 return false; 297 } 295 298 296 299 if ( null === $obj->ver ) { … … 304 307 } 305 308 306 $src = $obj->src; 307 $strategy = $this->get_eligible_loading_strategy( $handle ); 308 $intended_strategy = (string) $this->get_data( $handle, 'strategy' ); 309 $ie_conditional_prefix = ''; 310 $ie_conditional_suffix = ''; 311 $conditional = isset( $obj->extra['conditional'] ) ? $obj->extra['conditional'] : ''; 309 $src = $obj->src; 310 $strategy = $this->get_eligible_loading_strategy( $handle ); 311 $intended_strategy = (string) $this->get_data( $handle, 'strategy' ); 312 312 313 313 if ( ! $this->is_delayed_strategy( $intended_strategy ) ) { … … 334 334 } 335 335 336 if ( $conditional ) {337 $ie_conditional_prefix = "<!--[if {$conditional}]>\n";338 $ie_conditional_suffix = "<![endif]-->\n";339 }340 341 336 $before_script = $this->get_inline_script_tag( $handle, 'before' ); 342 337 $after_script = $this->get_inline_script_tag( $handle, 'after' ); 343 338 344 339 if ( $before_script || $after_script ) { 345 $inline_script_tag = $ ie_conditional_prefix . $before_script . $after_script . $ie_conditional_suffix;340 $inline_script_tag = $before_script . $after_script; 346 341 } else { 347 342 $inline_script_tag = ''; … … 379 374 _print_scripts(); 380 375 $this->reset(); 381 } elseif ( $this->in_default_dir( $filtered_src ) && ! $conditional) {376 } elseif ( $this->in_default_dir( $filtered_src ) ) { 382 377 $this->print_code .= $this->print_extra_script( $handle, false ); 383 378 $this->concat .= "$handle,"; … … 390 385 } 391 386 392 $has_conditional_data = $conditional && $this->get_data( $handle, 'data' );393 394 if ( $has_conditional_data ) {395 echo $ie_conditional_prefix;396 }397 398 387 $this->print_extra_script( $handle ); 399 400 if ( $has_conditional_data ) {401 echo $ie_conditional_suffix;402 }403 388 404 389 // A single item may alias a set of items, by having dependencies, but no source. … … 454 439 $attr['fetchpriority'] = $actual_fetchpriority; 455 440 } 441 456 442 if ( $original_fetchpriority !== $actual_fetchpriority ) { 457 443 $attr['data-wp-fetchpriority'] = $original_fetchpriority; 458 444 } 459 445 460 $tag = $translations . $ ie_conditional_prefix . $before_script;446 $tag = $translations . $before_script; 461 447 $tag .= wp_get_script_tag( $attr ); 462 $tag .= $after_script . $ie_conditional_suffix;448 $tag .= $after_script; 463 449 464 450 /** … … 850 836 if ( ! isset( $this->registered[ $handle ] ) ) { 851 837 return false; 838 } 839 840 if ( 'conditional' === $key ) { 841 // If a dependency is declared by a conditional script, remove it. 842 $this->registered[ $handle ]->deps = array(); 852 843 } 853 844
Note: See TracChangeset
for help on using the changeset viewer.