Skip to content

Commit 2dc3e2a

Browse files
committed
Merge branch 'trunk' into trac-64238-script-and-style-functions
2 parents 4cba94b + 5f7cef7 commit 2dc3e2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+679
-204
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-filesystem-direct.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,18 @@ public function owner( $file ) {
249249
/**
250250
* Gets the permissions of the specified file or filepath in their octal format.
251251
*
252-
* FIXME does not handle errors in fileperms()
253-
*
254252
* @since 2.5.0
255253
*
256254
* @param string $file Path to the file.
257-
* @return string Mode of the file (the last 3 digits).
255+
* @return string Mode of the file (the last 3 digits), or the string "0" on failure.
258256
*/
259257
public function getchmod( $file ) {
260-
return substr( decoct( @fileperms( $file ) ), -3 );
258+
$perms = @fileperms( $file );
259+
if ( false === $perms ) {
260+
return '0';
261+
}
262+
263+
return substr( decoct( $perms ), -3 );
261264
}
262265

263266
/**

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/media.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3769,8 +3769,8 @@ function wp_read_audio_metadata( $file ) {
37693769
* @link https://github.com/JamesHeinrich/getID3/blob/master/structure.txt
37703770
*
37713771
* @param array $metadata The metadata returned by getID3::analyze().
3772-
* @return int|false A UNIX timestamp for the media's creation date if available
3773-
* or a boolean FALSE if a timestamp could not be determined.
3772+
* @return int|false A Unix timestamp for the media's creation date if available
3773+
* or a boolean false if the timestamp could not be determined.
37743774
*/
37753775
function wp_get_media_creation_timestamp( $metadata ) {
37763776
$creation_date = false;

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-admin/widgets-form.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,9 +187,9 @@
187187

188188
// Remove old position.
189189
if ( ! isset( $_POST['delete_widget'] ) ) {
190-
foreach ( $sidebars_widgets as $sidebar_id => $sidebar ) {
191-
if ( is_array( $sidebar ) ) {
192-
$sidebars_widgets[ $sidebar_id ] = array_diff( $sidebar, array( $widget_id ) );
190+
foreach ( $sidebars_widgets as $sidebar_widget_id => $sidebar_widget ) {
191+
if ( is_array( $sidebar_widget ) ) {
192+
$sidebars_widgets[ $sidebar_widget_id ] = array_diff( $sidebar_widget, array( $widget_id ) );
193193
}
194194
}
195195

src/wp-content/themes/twentynineteen/style-editor.css

Lines changed: 36 additions & 31 deletions
Large diffs are not rendered by default.

src/wp-content/themes/twentynineteen/style-editor.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,3 +1095,9 @@ $group-block-background__padding: $font__size_base;
10951095
.wp-block-post-author__avatar img {
10961096
border-radius: 100%;
10971097
}
1098+
1099+
/** === Calendar Block === */
1100+
1101+
.wp-calendar-table {
1102+
@include font-family( $font__heading );
1103+
}

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.

0 commit comments

Comments
 (0)