Skip to content

Commit 05a45e1

Browse files
committed
Merge branch 'trunk' into 64418/improve-custom-css-handling
2 parents 2c19861 + 3d9fde3 commit 05a45e1

13 files changed

+177
-87
lines changed

src/wp-includes/class-wp-comment-query.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,12 +949,12 @@ protected function get_comment_ids() {
949949
*/
950950
$clauses = apply_filters_ref_array( 'comments_clauses', array( compact( $pieces ), &$this ) );
951951

952-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
953-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
954-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
955-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
956-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
957-
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
952+
$fields = $clauses['fields'] ?? '';
953+
$join = $clauses['join'] ?? '';
954+
$where = $clauses['where'] ?? '';
955+
$orderby = $clauses['orderby'] ?? '';
956+
$limits = $clauses['limits'] ?? '';
957+
$groupby = $clauses['groupby'] ?? '';
958958

959959
$this->filtered_where_clause = $where;
960960

src/wp-includes/class-wp-customize-manager.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,9 +1226,9 @@ public function import_theme_starter_content( $starter_content = array() ) {
12261226
$sidebars_widgets = isset( $starter_content['widgets'] ) && ! empty( $this->widgets ) ? $starter_content['widgets'] : array();
12271227
$attachments = isset( $starter_content['attachments'] ) && ! empty( $this->nav_menus ) ? $starter_content['attachments'] : array();
12281228
$posts = isset( $starter_content['posts'] ) && ! empty( $this->nav_menus ) ? $starter_content['posts'] : array();
1229-
$options = isset( $starter_content['options'] ) ? $starter_content['options'] : array();
1229+
$options = $starter_content['options'] ?? array();
12301230
$nav_menus = isset( $starter_content['nav_menus'] ) && ! empty( $this->nav_menus ) ? $starter_content['nav_menus'] : array();
1231-
$theme_mods = isset( $starter_content['theme_mods'] ) ? $starter_content['theme_mods'] : array();
1231+
$theme_mods = $starter_content['theme_mods'] ?? array();
12321232

12331233
// Widgets.
12341234
$max_widget_numbers = array();
@@ -1495,7 +1495,7 @@ public function import_theme_starter_content( $starter_content = array() ) {
14951495
$this->set_post_value(
14961496
$nav_menu_setting_id,
14971497
array(
1498-
'name' => isset( $nav_menu['name'] ) ? $nav_menu['name'] : $nav_menu_location,
1498+
'name' => $nav_menu['name'] ?? $nav_menu_location,
14991499
)
15001500
);
15011501
$this->pending_starter_content_settings_ids[] = $nav_menu_setting_id;
@@ -5239,10 +5239,10 @@ public function register_controls() {
52395239
'label' => __( 'Logo' ),
52405240
'section' => 'title_tagline',
52415241
'priority' => 8,
5242-
'height' => isset( $custom_logo_args[0]['height'] ) ? $custom_logo_args[0]['height'] : null,
5243-
'width' => isset( $custom_logo_args[0]['width'] ) ? $custom_logo_args[0]['width'] : null,
5244-
'flex_height' => isset( $custom_logo_args[0]['flex-height'] ) ? $custom_logo_args[0]['flex-height'] : null,
5245-
'flex_width' => isset( $custom_logo_args[0]['flex-width'] ) ? $custom_logo_args[0]['flex-width'] : null,
5242+
'height' => $custom_logo_args[0]['height'] ?? null,
5243+
'width' => $custom_logo_args[0]['width'] ?? null,
5244+
'flex_height' => $custom_logo_args[0]['flex-height'] ?? null,
5245+
'flex_width' => $custom_logo_args[0]['flex-width'] ?? null,
52465246
'button_labels' => array(
52475247
'select' => __( 'Select logo' ),
52485248
'change' => __( 'Change logo' ),

src/wp-includes/class-wp-http-requests-response.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ public function get_cookies() {
164164
array(
165165
'name' => $cookie->name,
166166
'value' => urldecode( $cookie->value ),
167-
'expires' => isset( $cookie->attributes['expires'] ) ? $cookie->attributes['expires'] : null,
168-
'path' => isset( $cookie->attributes['path'] ) ? $cookie->attributes['path'] : null,
169-
'domain' => isset( $cookie->attributes['domain'] ) ? $cookie->attributes['domain'] : null,
170-
'host_only' => isset( $cookie->flags['host-only'] ) ? $cookie->flags['host-only'] : null,
167+
'expires' => $cookie->attributes['expires'] ?? null,
168+
'path' => $cookie->attributes['path'] ?? null,
169+
'domain' => $cookie->attributes['domain'] ?? null,
170+
'host_only' => $cookie->flags['host-only'] ?? null,
171171
)
172172
);
173173
}

src/wp-includes/class-wp-network-query.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,12 +460,12 @@ protected function get_network_ids() {
460460
*/
461461
$clauses = apply_filters_ref_array( 'networks_clauses', array( compact( $pieces ), &$this ) );
462462

463-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
464-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
465-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
466-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
467-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
468-
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
463+
$fields = $clauses['fields'] ?? '';
464+
$join = $clauses['join'] ?? '';
465+
$where = $clauses['where'] ?? '';
466+
$orderby = $clauses['orderby'] ?? '';
467+
$limits = $clauses['limits'] ?? '';
468+
$groupby = $clauses['groupby'] ?? '';
469469

470470
if ( $where ) {
471471
$where = 'WHERE ' . $where;

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3019,13 +3019,13 @@ public function get_posts() {
30193019
*/
30203020
$clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
30213021

3022-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
3023-
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
3024-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
3025-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
3026-
$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
3027-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
3028-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
3022+
$where = $clauses['where'] ?? '';
3023+
$groupby = $clauses['groupby'] ?? '';
3024+
$join = $clauses['join'] ?? '';
3025+
$orderby = $clauses['orderby'] ?? '';
3026+
$distinct = $clauses['distinct'] ?? '';
3027+
$fields = $clauses['fields'] ?? '';
3028+
$limits = $clauses['limits'] ?? '';
30293029
}
30303030

30313031
/**
@@ -3153,13 +3153,13 @@ public function get_posts() {
31533153
*/
31543154
$clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
31553155

3156-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
3157-
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
3158-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
3159-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
3160-
$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
3161-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
3162-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
3156+
$where = $clauses['where'] ?? '';
3157+
$groupby = $clauses['groupby'] ?? '';
3158+
$join = $clauses['join'] ?? '';
3159+
$orderby = $clauses['orderby'] ?? '';
3160+
$distinct = $clauses['distinct'] ?? '';
3161+
$fields = $clauses['fields'] ?? '';
3162+
$limits = $clauses['limits'] ?? '';
31633163
}
31643164

31653165
if ( ! empty( $groupby ) ) {

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,9 @@ private function print_script_module( string $id ) {
461461
'id' => $id . '-js-module',
462462
);
463463

464-
$script_module = $this->registered[ $id ];
465-
$dependents = $this->get_recursive_dependents( $id );
466-
$fetchpriority = $this->get_highest_fetchpriority( array_merge( array( $id ), $dependents ) );
464+
$script_module = $this->registered[ $id ];
465+
$queued_dependents = array_intersect( $this->queue, $this->get_recursive_dependents( $id ) );
466+
$fetchpriority = $this->get_highest_fetchpriority( array_merge( array( $id ), $queued_dependents ) );
467467
if ( 'auto' !== $fetchpriority ) {
468468
$attributes['fetchpriority'] = $fetchpriority;
469469
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ private function filter_eligible_strategies( $handle, $eligible_strategies = nul
10921092
*
10931093
* @since 6.9.0
10941094
* @see self::filter_eligible_strategies()
1095-
* @see WP_Script_Modules::get_highest_fetchpriority_with_dependents()
1095+
* @see WP_Script_Modules::get_highest_fetchpriority()
10961096
*
10971097
* @param string $handle Script module ID.
10981098
* @param array<string, true> $checked Optional. An array of already checked script handles, used to avoid recursive loops.

src/wp-includes/class-wp-site-query.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,12 @@ protected function get_site_ids() {
674674
*/
675675
$clauses = apply_filters_ref_array( 'sites_clauses', array( compact( $pieces ), &$this ) );
676676

677-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
678-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
679-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
680-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
681-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
682-
$groupby = isset( $clauses['groupby'] ) ? $clauses['groupby'] : '';
677+
$fields = $clauses['fields'] ?? '';
678+
$join = $clauses['join'] ?? '';
679+
$where = $clauses['where'] ?? '';
680+
$orderby = $clauses['orderby'] ?? '';
681+
$limits = $clauses['limits'] ?? '';
682+
$groupby = $clauses['groupby'] ?? '';
683683

684684
if ( $where ) {
685685
$where = 'WHERE ' . $where;

src/wp-includes/class-wp-term-query.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -727,13 +727,13 @@ public function get_terms() {
727727
*/
728728
$clauses = apply_filters( 'terms_clauses', compact( $pieces ), $taxonomies, $args );
729729

730-
$fields = isset( $clauses['fields'] ) ? $clauses['fields'] : '';
731-
$join = isset( $clauses['join'] ) ? $clauses['join'] : '';
732-
$where = isset( $clauses['where'] ) ? $clauses['where'] : '';
733-
$distinct = isset( $clauses['distinct'] ) ? $clauses['distinct'] : '';
734-
$orderby = isset( $clauses['orderby'] ) ? $clauses['orderby'] : '';
735-
$order = isset( $clauses['order'] ) ? $clauses['order'] : '';
736-
$limits = isset( $clauses['limits'] ) ? $clauses['limits'] : '';
730+
$fields = $clauses['fields'] ?? '';
731+
$join = $clauses['join'] ?? '';
732+
$where = $clauses['where'] ?? '';
733+
$distinct = $clauses['distinct'] ?? '';
734+
$orderby = $clauses['orderby'] ?? '';
735+
$order = $clauses['order'] ?? '';
736+
$limits = $clauses['limits'] ?? '';
737737

738738
$fields_is_filtered = implode( ', ', $selects ) !== $fields;
739739

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

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) {
141141
),
142142
'4.5.0'
143143
);
144-
$data = trim( preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
144+
$data = trim( (string) preg_replace( '#<script[^>]*>(.*)</script>#is', '$1', $data ) );
145145
}
146146

147147
return wp_scripts()->add_inline_script( $handle, $data, $position );
@@ -160,15 +160,15 @@ function wp_add_inline_script( $handle, $data, $position = 'after' ) {
160160
* @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
161161
* @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array.
162162
*
163-
* @param string $handle Name of the script. Should be unique.
164-
* @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
165-
* If source is set to false, script is an alias of other scripts it depends on.
166-
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
167-
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
168-
* as a query string for cache busting purposes. If version is set to false, a version
169-
* number is automatically added equal to current installed WordPress version.
170-
* If set to null, no version is added.
171-
* @param array|bool $args {
163+
* @param string $handle Name of the script. Should be unique.
164+
* @param string|false $src Full URL of the script, or path of the script relative to the WordPress root directory.
165+
* If source is set to false, script is an alias of other scripts it depends on.
166+
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
167+
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
168+
* as a query string for cache busting purposes. If version is set to false, a version
169+
* number is automatically added equal to current installed WordPress version.
170+
* If set to null, no version is added.
171+
* @param array<string, string|bool>|bool $args {
172172
* Optional. An array of additional script loading strategies. Default empty array.
173173
* Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
174174
*
@@ -221,10 +221,10 @@ function wp_register_script( $handle, $src, $deps = array(), $ver = false, $args
221221
*
222222
* @todo Documentation cleanup
223223
*
224-
* @param string $handle Script handle the data will be attached to.
225-
* @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
226-
* Example: '/[a-zA-Z0-9_]+/'.
227-
* @param array $l10n The data itself. The data can be either a single or multi-dimensional array.
224+
* @param string $handle Script handle the data will be attached to.
225+
* @param string $object_name Name for the JavaScript object. Passed directly, so it should be qualified JS variable.
226+
* Example: '/[a-zA-Z0-9_]+/'.
227+
* @param array<string, mixed> $l10n The data itself. The data can be either a single or multi-dimensional array.
228228
* @return bool True if the script was successfully localized, false otherwise.
229229
*/
230230
function wp_localize_script( $handle, $object_name, $l10n ) {
@@ -346,15 +346,15 @@ function wp_deregister_script( $handle ) {
346346
* @since 6.3.0 The $in_footer parameter of type boolean was overloaded to be an $args parameter of type array.
347347
* @since 6.9.0 The $fetchpriority parameter of type string was added to the $args parameter of type array.
348348
*
349-
* @param string $handle Name of the script. Should be unique.
350-
* @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
351-
* Default empty.
352-
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
353-
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
354-
* as a query string for cache busting purposes. If version is set to false, a version
355-
* number is automatically added equal to current installed WordPress version.
356-
* If set to null, no version is added.
357-
* @param array|bool $args {
349+
* @param string $handle Name of the script. Should be unique.
350+
* @param string $src Full URL of the script, or path of the script relative to the WordPress root directory.
351+
* Default empty.
352+
* @param string[] $deps Optional. An array of registered script handles this script depends on. Default empty array.
353+
* @param string|bool|null $ver Optional. String specifying script version number, if it has one, which is added to the URL
354+
* as a query string for cache busting purposes. If version is set to false, a version
355+
* number is automatically added equal to current installed WordPress version.
356+
* If set to null, no version is added.
357+
* @param array<string, string|bool>|bool $args {
358358
* Optional. An array of additional script loading strategies. Default empty array.
359359
* Otherwise, it may be a boolean in which case it determines whether the script is printed in the footer. Default false.
360360
*

0 commit comments

Comments
 (0)