Changeset 61587 for trunk/src/wp-includes/class-wp-scripts.php
- Timestamp:
- 02/04/2026 01:41:25 AM (8 weeks ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-scripts.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-scripts.php
r61542 r61587 921 921 return false; 922 922 } 923 } elseif ( 'module_dependencies' === $key ) { 924 if ( ! is_array( $value ) ) { 925 _doing_it_wrong( 926 __METHOD__, 927 sprintf( 928 /* translators: 1: 'module_dependencies', 2: Script handle. */ 929 __( 'The value for "%1$s" must be an array for the "%2$s" script.' ), 930 'module_dependencies', 931 $handle 932 ), 933 '7.0.0' 934 ); 935 return false; 936 } 937 938 $sanitized_value = array(); 939 $has_invalid_ids = false; 940 foreach ( $value as $module ) { 941 if ( 942 is_string( $module ) || 943 ( is_array( $module ) && isset( $module['id'] ) && is_string( $module['id'] ) ) 944 ) { 945 $sanitized_value[] = $module; 946 } else { 947 $has_invalid_ids = true; 948 } 949 } 950 951 if ( $has_invalid_ids ) { 952 _doing_it_wrong( 953 __METHOD__, 954 sprintf( 955 /* translators: 1: Script handle, 2: 'module_dependencies' */ 956 __( 'The script handle "%1$s" has one or more of its script module dependencies ("%2$s") which are invalid.' ), 957 $handle, 958 'module_dependencies' 959 ), 960 '7.0.0' 961 ); 962 } 963 964 $value = $sanitized_value; 923 965 } 924 966 return parent::add_data( $handle, $key, $value );
Note: See TracChangeset
for help on using the changeset viewer.