Changeset 61323 for trunk/src/wp-includes/class-wp-script-modules.php
- Timestamp:
- 11/30/2025 12:54:26 AM (5 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-script-modules.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-script-modules.php
r61073 r61323 70 70 'high', 71 71 ); 72 73 /** 74 * List of IDs for script modules encountered which have missing dependencies. 75 * 76 * An ID is added to this list when it is discovered to have missing dependencies. At this time, a warning is 77 * emitted with {@see _doing_it_wrong()}. The ID is then added to this list, so that duplicate warnings don't occur. 78 * 79 * @since 7.0.0 80 * @var string[] 81 */ 82 private $modules_with_missing_dependencies = array(); 72 83 73 84 /** … … 723 734 724 735 // If the item requires dependencies that do not exist, fail. 725 if ( count( array_diff( $dependency_ids, array_keys( $this->registered ) ) ) > 0 ) { 736 $missing_dependencies = array_diff( $dependency_ids, array_keys( $this->registered ) ); 737 if ( count( $missing_dependencies ) > 0 ) { 738 if ( ! in_array( $id, $this->modules_with_missing_dependencies, true ) ) { 739 _doing_it_wrong( 740 get_class( $this ) . '::register', 741 sprintf( 742 /* translators: 1: Script module ID, 2: Comma-separated list of missing dependency IDs. */ 743 __( 'The script module with the ID "%1$s" was enqueued with dependencies that are not registered: %2$s.' ), 744 $id, 745 implode( ', ', $missing_dependencies ) 746 ), 747 '7.0.0' 748 ); 749 $this->modules_with_missing_dependencies[] = $id; 750 } 751 726 752 return false; 727 753 }
Note: See TracChangeset
for help on using the changeset viewer.