Skip to content

Commit e8e78a6

Browse files
committed
Merge branch 'trunk' into fix/getchmod-error-handling
2 parents 7da3481 + c4d8047 commit e8e78a6

36 files changed

+514
-147
lines changed

src/wp-admin/customize.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,8 @@
147147
$body_class .= ' rtl';
148148
}
149149
$body_class .= ' locale-' . sanitize_html_class( strtolower( str_replace( '_', '-', get_user_locale() ) ) );
150+
$admin_color = get_user_option( 'admin_color' );
151+
$body_class .= ' admin-color-' . sanitize_html_class( is_string( $admin_color ) ? $admin_color : '', 'fresh' );
150152

151153
if ( wp_use_widgets_block_editor() ) {
152154
$body_class .= ' wp-embed-responsive';

src/wp-admin/includes/class-wp-upgrader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ public function install_package( $args = array() ) {
590590
* Filters the source file location for the upgrade package.
591591
*
592592
* @since 2.8.0
593-
* @since 4.4.0 The $hook_extra parameter became available.
593+
* @since 4.4.0 The `$hook_extra` parameter became available.
594594
*
595595
* @param string $source File source location.
596596
* @param string $remote_source Remote file source location.

src/wp-admin/includes/post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ function _admin_notice_post_locked() {
18941894
* Fires inside the post locked dialog before the buttons are displayed.
18951895
*
18961896
* @since 3.6.0
1897-
* @since 5.4.0 The $user parameter was added.
1897+
* @since 5.4.0 The `$user` parameter was added.
18981898
*
18991899
* @param WP_Post $post Post object.
19001900
* @param WP_User $user The user with the lock for the post.

src/wp-includes/abilities-api/class-wp-ability.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,15 @@ protected function prepare_properties( array $args ): array {
277277
);
278278
}
279279

280-
if ( empty( $args['execute_callback'] ) || ! is_callable( $args['execute_callback'] ) ) {
280+
// If we are not overriding `ability_class` parameter during instantiation, then we need to validate the execute_callback.
281+
if ( get_class( $this ) === self::class && ( empty( $args['execute_callback'] ) || ! is_callable( $args['execute_callback'] ) ) ) {
281282
throw new InvalidArgumentException(
282283
__( 'The ability properties must contain a valid `execute_callback` function.' )
283284
);
284285
}
285286

286-
if ( empty( $args['permission_callback'] ) || ! is_callable( $args['permission_callback'] ) ) {
287+
// If we are not overriding `ability_class` parameter during instantiation, then we need to validate the permission_callback.
288+
if ( get_class( $this ) === self::class && ( empty( $args['permission_callback'] ) || ! is_callable( $args['permission_callback'] ) ) ) {
287289
throw new InvalidArgumentException(
288290
__( 'The ability properties must provide a valid `permission_callback` function.' )
289291
);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ public function value() {
765765
* functions for available hooks.
766766
*
767767
* @since 3.4.0
768-
* @since 4.6.0 Added the `$this` setting instance as the second parameter.
768+
* @since 4.6.0 Added the `$setting` instance as the second parameter.
769769
*
770770
* @param mixed $default_value The setting default value. Default empty.
771771
* @param WP_Customize_Setting $setting The setting instance.

src/wp-includes/class-wp-image-editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ public function set_quality( $quality = null, $dims = array() ) {
255255
* The WP_Image_Editor::set_quality() method has priority over the filter.
256256
*
257257
* @since 3.5.0
258-
* @since 6.8.0 Added the size parameter.
258+
* @since 6.8.0 Added the `$size` parameter.
259259
*
260260
* @param int $quality Quality level between 1 (low) and 100 (high).
261261
* @param string $mime_type Image mime type.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1900,8 +1900,8 @@ public function get_posts() {
19001900
* Fires after the query variable object is created, but before the actual query is run.
19011901
*
19021902
* Note: If using conditional tags, use the method versions within the passed instance
1903-
* (e.g. $this->is_main_query() instead of is_main_query()). This is because the functions
1904-
* like is_main_query() test against the global $wp_query instance, not the passed one.
1903+
* (e.g. `$query->is_main_query()` instead of `is_main_query()`). This is because the functions
1904+
* like `is_main_query()` test against the global `$wp_query` instance, not the passed one.
19051905
*
19061906
* @since 2.0.0
19071907
*

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

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,26 @@ class WP_Scripts extends WP_Dependencies {
2222
* Full URL with trailing slash.
2323
*
2424
* @since 2.6.0
25-
* @var string
25+
* @see wp_default_scripts()
26+
* @var string|null
2627
*/
2728
public $base_url;
2829

2930
/**
3031
* URL of the content directory.
3132
*
3233
* @since 2.8.0
33-
* @var string
34+
* @see wp_default_scripts()
35+
* @var string|null
3436
*/
3537
public $content_url;
3638

3739
/**
3840
* Default version string for scripts.
3941
*
4042
* @since 2.6.0
41-
* @var string
43+
* @see wp_default_scripts()
44+
* @var string|null
4245
*/
4346
public $default_version;
4447

@@ -118,6 +121,7 @@ class WP_Scripts extends WP_Dependencies {
118121
* List of default directories.
119122
*
120123
* @since 2.8.0
124+
* @see wp_default_scripts()
121125
* @var string[]|null
122126
*/
123127
public $default_dirs;
@@ -413,9 +417,19 @@ public function do_item( $handle, $group = false ) {
413417
$src = $this->base_url . $src;
414418
}
415419

416-
if ( ! empty( $ver ) ) {
417-
$src = add_query_arg( 'ver', $ver, $src );
420+
$query_args = array();
421+
if ( empty( $obj->ver ) && null !== $obj->ver && is_string( $this->default_version ) ) {
422+
$query_args['ver'] = $this->default_version;
423+
} elseif ( is_scalar( $obj->ver ) ) {
424+
$query_args['ver'] = (string) $obj->ver;
425+
}
426+
if ( isset( $this->args[ $handle ] ) ) {
427+
parse_str( $this->args[ $handle ], $parsed_args );
428+
if ( $parsed_args ) {
429+
$query_args = array_merge( $query_args, $parsed_args );
430+
}
418431
}
432+
$src = add_query_arg( rawurlencode_deep( $query_args ), $src );
419433

420434
/** This filter is documented in wp-includes/class-wp-scripts.php */
421435
$src = esc_url_raw( apply_filters( 'script_loader_src', $src, $handle ) );

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

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,30 +22,34 @@ class WP_Styles extends WP_Dependencies {
2222
* Full URL with trailing slash.
2323
*
2424
* @since 2.6.0
25-
* @var string
25+
* @see wp_default_styles()
26+
* @var string|null
2627
*/
2728
public $base_url;
2829

2930
/**
3031
* URL of the content directory.
3132
*
3233
* @since 2.8.0
33-
* @var string
34+
* @see wp_default_styles()
35+
* @var string|null
3436
*/
3537
public $content_url;
3638

3739
/**
3840
* Default version string for stylesheets.
3941
*
4042
* @since 2.6.0
41-
* @var string
43+
* @see wp_default_styles()
44+
* @var string|null
4245
*/
4346
public $default_version;
4447

4548
/**
4649
* The current text direction.
4750
*
4851
* @since 2.6.0
52+
* @see wp_default_styles()
4953
* @var string
5054
*/
5155
public $text_direction = 'ltr';
@@ -96,6 +100,7 @@ class WP_Styles extends WP_Dependencies {
96100
* List of default directories.
97101
*
98102
* @since 2.8.0
103+
* @see wp_default_styles()
99104
* @var string[]|null
100105
*/
101106
public $default_dirs;
@@ -118,9 +123,15 @@ class WP_Styles extends WP_Dependencies {
118123
*/
119124
public function __construct() {
120125
if (
121-
function_exists( 'is_admin' ) && ! is_admin()
122-
&&
123-
function_exists( 'current_theme_supports' ) && ! current_theme_supports( 'html5', 'style' )
126+
(
127+
function_exists( 'is_admin' ) &&
128+
! is_admin()
129+
)
130+
&&
131+
(
132+
function_exists( 'current_theme_supports' ) &&
133+
! current_theme_supports( 'html5', 'style' )
134+
)
124135
) {
125136
$this->type_attr = " type='text/css'";
126137
}
@@ -212,7 +223,7 @@ public function do_item( $handle, $group = false ) {
212223
return true;
213224
}
214225

215-
$href = $this->_css_href( $src, $ver, $handle );
226+
$href = $this->_css_href( $src, $obj->ver, $handle );
216227
if ( ! $href ) {
217228
return true;
218229
}
@@ -419,19 +430,29 @@ public function all_deps( $handles, $recursion = false, $group = false ) {
419430
*
420431
* @since 2.6.0
421432
*
422-
* @param string $src The source of the enqueued style.
423-
* @param string $ver The version of the enqueued style.
424-
* @param string $handle The style's registered handle.
433+
* @param string $src The source of the enqueued style.
434+
* @param string|false|null $ver The version of the enqueued style.
435+
* @param string $handle The style's registered handle.
425436
* @return string Style's fully-qualified URL.
426437
*/
427438
public function _css_href( $src, $ver, $handle ) {
428439
if ( ! is_bool( $src ) && ! preg_match( '|^(https?:)?//|', $src ) && ! ( $this->content_url && str_starts_with( $src, $this->content_url ) ) ) {
429440
$src = $this->base_url . $src;
430441
}
431442

432-
if ( ! empty( $ver ) ) {
433-
$src = add_query_arg( 'ver', $ver, $src );
443+
$query_args = array();
444+
if ( empty( $ver ) && null !== $ver && is_string( $this->default_version ) ) {
445+
$query_args['ver'] = $this->default_version;
446+
} elseif ( is_scalar( $ver ) ) {
447+
$query_args['ver'] = (string) $ver;
448+
}
449+
if ( isset( $this->args[ $handle ] ) ) {
450+
parse_str( $this->args[ $handle ], $parsed_args );
451+
if ( $parsed_args ) {
452+
$query_args = array_merge( $query_args, $parsed_args );
453+
}
434454
}
455+
$src = add_query_arg( rawurlencode_deep( $query_args ), $src );
435456

436457
/**
437458
* Filters an enqueued style's fully-qualified URL.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ public function query() {
851851
* Filters SELECT FOUND_ROWS() query for the current WP_User_Query instance.
852852
*
853853
* @since 3.2.0
854-
* @since 5.1.0 Added the `$this` parameter.
854+
* @since 5.1.0 Added the `$query` parameter.
855855
*
856856
* @global wpdb $wpdb WordPress database abstraction object.
857857
*

0 commit comments

Comments
 (0)