Skip to content

Commit 1ae45d3

Browse files
committed
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develop into add/61244-empty-comment-export-tests
2 parents 141982e + 54c8458 commit 1ae45d3

17 files changed

+298
-155
lines changed

src/wp-admin/includes/class-wp-debug-data.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1592,6 +1592,11 @@ private static function get_wp_constants(): array {
15921592
'value' => $db_collate,
15931593
'debug' => $db_collate_debug,
15941594
),
1595+
'EMPTY_TRASH_DAYS' => array(
1596+
'label' => 'EMPTY_TRASH_DAYS',
1597+
'value' => EMPTY_TRASH_DAYS ? EMPTY_TRASH_DAYS : __( 'Empty value' ),
1598+
'debug' => EMPTY_TRASH_DAYS,
1599+
),
15951600
);
15961601

15971602
return array(

src/wp-admin/includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,7 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
764764
if ( $create_in_db ) {
765765
$post_id = wp_insert_post(
766766
array(
767-
'post_title' => __( 'Auto Draft' ),
767+
'post_title' => post_type_supports( $post_type, 'title' ) ? __( 'Auto Draft' ) : '',
768768
'post_type' => $post_type,
769769
'post_status' => 'auto-draft',
770770
),

src/wp-admin/install.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
*
5353
* @since 2.5.0
5454
*
55-
* @param string $body_classes
55+
* @param string $body_classes Class attribute values for the body tag.
5656
*/
5757
function display_header( $body_classes = '' ) {
5858
header( 'Content-Type: text/html; charset=utf-8' );
@@ -85,7 +85,7 @@ function display_header( $body_classes = '' ) {
8585
*
8686
* @global wpdb $wpdb WordPress database abstraction object.
8787
*
88-
* @param string|null $error
88+
* @param string|null $error Error message to display, if any.
8989
*/
9090
function display_setup_form( $error = null ) {
9191
global $wpdb;

src/wp-admin/network/site-new.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -217,17 +217,18 @@
217217
</label>
218218
</th>
219219
<td>
220-
<?php if ( is_subdomain_install() ) { ?>
221-
<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
222-
<?php
223-
} else {
224-
echo get_network()->domain . get_network()->path
225-
?>
226-
<input name="blog[domain]" type="text" class="regular-text ltr" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
227-
<?php
228-
}
229-
echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
230-
?>
220+
<span class="code">
221+
<?php if ( is_subdomain_install() ) : ?>
222+
<input name="blog[domain]" type="text" class="regular-text code" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><!--
223+
--><code class="no-break"><?php echo esc_html( '.' . preg_replace( '|^www\.|', '', get_network()->domain ) ); ?></code>
224+
<?php else : ?>
225+
<code class="no-break"><?php echo esc_html( get_network()->domain . get_network()->path ); ?></code><!--
226+
--><input name="blog[domain]" type="text" class="regular-text code" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
227+
<?php endif; ?>
228+
</span>
229+
<p class="description" id="site-address-desc">
230+
<?php _e( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ); ?>
231+
</p>
231232
</td>
232233
</tr>
233234
<tr class="form-field form-required">

src/wp-includes/class-wp-dependencies.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,12 @@ class WP_Dependencies {
5656
/**
5757
* An array of additional arguments passed when a handle is registered.
5858
*
59-
* Arguments are appended to the item query string.
59+
* The keys are dependency handles and the values are query strings which are appended to the item URL's query
60+
* string, after the `ver` if provided.
6061
*
6162
* @since 2.6.0
6263
*
63-
* @var array
64+
* @var array<string, string>
6465
*/
6566
public $args = array();
6667

@@ -100,7 +101,7 @@ class WP_Dependencies {
100101
*
101102
* @since 5.9.0
102103
*
103-
* @var array
104+
* @var array<string, string|null>
104105
*/
105106
private $queued_before_register = array();
106107

@@ -111,7 +112,7 @@ class WP_Dependencies {
111112
* warning is emitted with {@see _doing_it_wrong()}. The handle is then added to this list, so that duplicate
112113
* warnings don't occur.
113114
*
114-
* @since 7.0.0
115+
* @since 6.9.1
115116
* @var string[]
116117
*/
117118
private $dependencies_with_missing_dependencies = array();
@@ -223,7 +224,7 @@ public function all_deps( $handles, $recursion = false, $group = false ) {
223224
_doing_it_wrong(
224225
get_class( $this ) . '::add',
225226
$this->get_dependency_warning_message( $handle, $missing_dependencies ),
226-
'7.0.0'
227+
'6.9.1'
227228
);
228229
$this->dependencies_with_missing_dependencies[] = $handle;
229230
}
@@ -563,7 +564,7 @@ public function get_etag( $load ) {
563564
/**
564565
* Gets a dependency warning message for a handle.
565566
*
566-
* @since 7.0.0
567+
* @since 6.9.1
567568
*
568569
* @param string $handle Handle with missing dependencies.
569570
* @param string[] $missing_dependency_handles Missing dependency handles.

src/wp-includes/class-wp-dependency.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class _WP_Dependency {
6666
* Extra data to supply to the handle.
6767
*
6868
* @since 2.6.0
69-
* @var array
69+
* @var array<string, mixed>
7070
*/
7171
public $extra = array();
7272

@@ -82,7 +82,7 @@ class _WP_Dependency {
8282
* Translation path set for this dependency.
8383
*
8484
* @since 5.0.0
85-
* @var string
85+
* @var string|null
8686
*/
8787
public $translations_path;
8888

src/wp-includes/class-wp-script-modules.php

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class WP_Script_Modules {
7676
* An ID is added to this list when it is discovered to have missing dependencies. At this time, a warning is
7777
* emitted with {@see _doing_it_wrong()}. The ID is then added to this list, so that duplicate warnings don't occur.
7878
*
79-
* @since 7.0.0
79+
* @since 6.9.1
8080
* @var string[]
8181
*/
8282
private $modules_with_missing_dependencies = array();
@@ -88,31 +88,31 @@ class WP_Script_Modules {
8888
* @since 6.5.0
8989
* @since 6.9.0 Added the $args parameter.
9090
*
91-
* @param string $id The identifier of the script module. Should be unique. It will be used in the
92-
* final import map.
93-
* @param string $src Optional. Full URL of the script module, or path of the script module relative
94-
* to the WordPress root directory. If it is provided and the script module has
95-
* not been registered yet, it will be registered.
96-
* @param array $deps {
97-
* Optional. List of dependencies.
98-
*
99-
* @type string|array ...$0 {
100-
* An array of script module identifiers of the dependencies of this script
101-
* module. The dependencies can be strings or arrays. If they are arrays,
102-
* they need an `id` key with the script module identifier, and can contain
103-
* an `import` key with either `static` or `dynamic`. By default,
104-
* dependencies that don't contain an `import` key are considered static.
105-
*
106-
* @type string $id The script module identifier.
107-
* @type string $import Optional. Import type. May be either `static` or
108-
* `dynamic`. Defaults to `static`.
109-
* }
110-
* }
111-
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
112-
* It is added to the URL as a query string for cache busting purposes. If $version
113-
* is set to false, the version number is the currently installed WordPress version.
114-
* If $version is set to null, no version is added.
115-
* @param array $args {
91+
* @param string $id The identifier of the script module. Should be unique. It will be used in the
92+
* final import map.
93+
* @param string $src Optional. Full URL of the script module, or path of the script module relative
94+
* to the WordPress root directory. If it is provided and the script module has
95+
* not been registered yet, it will be registered.
96+
* @param array<string|array> $deps {
97+
* Optional. List of dependencies.
98+
*
99+
* @type string|array ...$0 {
100+
* An array of script module identifiers of the dependencies of this script
101+
* module. The dependencies can be strings or arrays. If they are arrays,
102+
* they need an `id` key with the script module identifier, and can contain
103+
* an `import` key with either `static` or `dynamic`. By default,
104+
* dependencies that don't contain an `import` key are considered static.
105+
*
106+
* @type string $id The script module identifier.
107+
* @type string $import Optional. Import type. May be either `static` or
108+
* `dynamic`. Defaults to `static`.
109+
* }
110+
* }
111+
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
112+
* It is added to the URL as a query string for cache busting purposes. If $version
113+
* is set to false, the version number is the currently installed WordPress version.
114+
* If $version is set to null, no version is added.
115+
* @param array<string, string|bool> $args {
116116
* Optional. An array of additional args. Default empty array.
117117
*
118118
* @type bool $in_footer Whether to print the script module in the footer. Only relevant to block themes. Default 'false'. Optional.
@@ -260,31 +260,31 @@ public function set_in_footer( string $id, bool $in_footer ): bool {
260260
* @since 6.5.0
261261
* @since 6.9.0 Added the $args parameter.
262262
*
263-
* @param string $id The identifier of the script module. Should be unique. It will be used in the
264-
* final import map.
265-
* @param string $src Optional. Full URL of the script module, or path of the script module relative
266-
* to the WordPress root directory. If it is provided and the script module has
267-
* not been registered yet, it will be registered.
268-
* @param array $deps {
269-
* Optional. List of dependencies.
270-
*
271-
* @type string|array ...$0 {
272-
* An array of script module identifiers of the dependencies of this script
273-
* module. The dependencies can be strings or arrays. If they are arrays,
274-
* they need an `id` key with the script module identifier, and can contain
275-
* an `import` key with either `static` or `dynamic`. By default,
276-
* dependencies that don't contain an `import` key are considered static.
277-
*
278-
* @type string $id The script module identifier.
279-
* @type string $import Optional. Import type. May be either `static` or
280-
* `dynamic`. Defaults to `static`.
281-
* }
282-
* }
283-
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
284-
* It is added to the URL as a query string for cache busting purposes. If $version
285-
* is set to false, the version number is the currently installed WordPress version.
286-
* If $version is set to null, no version is added.
287-
* @param array $args {
263+
* @param string $id The identifier of the script module. Should be unique. It will be used in the
264+
* final import map.
265+
* @param string $src Optional. Full URL of the script module, or path of the script module relative
266+
* to the WordPress root directory. If it is provided and the script module has
267+
* not been registered yet, it will be registered.
268+
* @param array<string|array> $deps {
269+
* Optional. List of dependencies.
270+
*
271+
* @type string|array ...$0 {
272+
* An array of script module identifiers of the dependencies of this script
273+
* module. The dependencies can be strings or arrays. If they are arrays,
274+
* they need an `id` key with the script module identifier, and can contain
275+
* an `import` key with either `static` or `dynamic`. By default,
276+
* dependencies that don't contain an `import` key are considered static.
277+
*
278+
* @type string $id The script module identifier.
279+
* @type string $import Optional. Import type. May be either `static` or
280+
* `dynamic`. Defaults to `static`.
281+
* }
282+
* }
283+
* @param string|false|null $version Optional. String specifying the script module version number. Defaults to false.
284+
* It is added to the URL as a query string for cache busting purposes. If $version
285+
* is set to false, the version number is the currently installed WordPress version.
286+
* If $version is set to null, no version is added.
287+
* @param array<string, string|bool> $args {
288288
* Optional. An array of additional args. Default empty array.
289289
*
290290
* @type bool $in_footer Whether to print the script module in the footer. Only relevant to block themes. Default 'false'. Optional.
@@ -534,8 +534,8 @@ public function print_import_map() {
534534
*
535535
* @since 6.5.0
536536
*
537-
* @return array Array with an `imports` key mapping to an array of script module identifiers and their respective
538-
* URLs, including the version query.
537+
* @return array<string, array<string, string>> Array with an `imports` key mapping to an array of script module
538+
* identifiers and their respective URLs, including the version query.
539539
*/
540540
private function get_import_map(): array {
541541
$imports = array();
@@ -556,7 +556,7 @@ private function get_import_map(): array {
556556
*
557557
* @since 6.5.0
558558
*
559-
* @return array<string, array> Script modules marked for enqueue, keyed by script module identifier.
559+
* @return array<string, array<string, mixed>> Script modules marked for enqueue, keyed by script module identifier.
560560
*/
561561
private function get_marked_for_enqueue(): array {
562562
return wp_array_slice_assoc(
@@ -577,7 +577,7 @@ private function get_marked_for_enqueue(): array {
577577
* @param string[] $ids The identifiers of the script modules for which to gather dependencies.
578578
* @param string[] $import_types Optional. Import types of dependencies to retrieve: 'static', 'dynamic', or both.
579579
* Default is both.
580-
* @return array<string, array> List of dependencies, keyed by script module identifier.
580+
* @return array<string, array<string, mixed>> List of dependencies, keyed by script module identifier.
581581
*/
582582
private function get_dependencies( array $ids, array $import_types = array( 'static', 'dynamic' ) ): array {
583583
$all_dependencies = array();
@@ -744,7 +744,7 @@ private function sort_item_dependencies( string $id, array $import_types, array
744744
$id,
745745
implode( ', ', $missing_dependencies )
746746
),
747-
'7.0.0'
747+
'6.9.1'
748748
);
749749
$this->modules_with_missing_dependencies[] = $id;
750750
}

src/wp-includes/class-wp-scripts.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class WP_Scripts extends WP_Dependencies {
4646
* Holds handles of scripts which are enqueued in footer.
4747
*
4848
* @since 2.8.0
49-
* @var array
49+
* @var string[]
5050
*/
5151
public $in_footer = array();
5252

@@ -118,7 +118,7 @@ class WP_Scripts extends WP_Dependencies {
118118
* List of default directories.
119119
*
120120
* @since 2.8.0
121-
* @var array
121+
* @var string[]|null
122122
*/
123123
public $default_dirs;
124124

@@ -374,7 +374,8 @@ public function do_item( $handle, $group = false ) {
374374
$filtered_src = apply_filters( 'script_loader_src', $src, $handle );
375375

376376
if (
377-
$this->in_default_dir( $filtered_src )
377+
is_string( $filtered_src )
378+
&& $this->in_default_dir( $filtered_src )
378379
&& ( $before_script || $after_script || $translations_stop_concat || $this->is_delayed_strategy( $strategy ) )
379380
) {
380381
$this->do_concat = false;
@@ -589,9 +590,9 @@ public function get_inline_script_tag( $handle, $position = 'after' ) {
589590
*
590591
* @since 2.1.0
591592
*
592-
* @param string $handle Name of the script to attach data to.
593-
* @param string $object_name Name of the variable that will contain the data.
594-
* @param array $l10n Array of data to localize.
593+
* @param string $handle Name of the script to attach data to.
594+
* @param string $object_name Name of the variable that will contain the data.
595+
* @param array<string, mixed> $l10n Array of data to localize.
595596
* @return bool True on success, false on failure.
596597
*/
597598
public function localize( $handle, $object_name, $l10n ) {
@@ -1168,7 +1169,7 @@ public function reset() {
11681169
/**
11691170
* Gets a script-specific dependency warning message.
11701171
*
1171-
* @since 7.0.0
1172+
* @since 6.9.1
11721173
*
11731174
* @param string $handle Script handle with missing dependencies.
11741175
* @param string[] $missing_dependency_handles Missing dependency handles.

src/wp-includes/class-wp-styles.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ class WP_Styles extends WP_Dependencies {
9696
* List of default directories.
9797
*
9898
* @since 2.8.0
99-
* @var array
99+
* @var string[]|null
100100
*/
101101
public $default_dirs;
102102

@@ -183,7 +183,7 @@ public function do_item( $handle, $group = false ) {
183183
}
184184

185185
if ( $this->do_concat ) {
186-
if ( $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
186+
if ( is_string( $src ) && $this->in_default_dir( $src ) && ! isset( $obj->extra['alt'] ) ) {
187187
$this->concat .= "$handle,";
188188
$this->concat_version .= "$handle$ver";
189189

@@ -497,7 +497,7 @@ public function reset() {
497497
/**
498498
* Gets a style-specific dependency warning message.
499499
*
500-
* @since 7.0.0
500+
* @since 6.9.1
501501
*
502502
* @param string $handle Style handle with missing dependencies.
503503
* @param string[] $missing_dependency_handles Missing dependency handles.

0 commit comments

Comments
 (0)