Skip to content

Commit 9d02203

Browse files
committed
Merge branch 'trunk' of https://github.com/WordPress/wordpress-develop into trac-63543
2 parents e0f668a + 49e642d commit 9d02203

File tree

17 files changed

+852
-249
lines changed

17 files changed

+852
-249
lines changed

src/wp-content/themes/twentynineteen/sass/navigation/_menu-main-navigation.scss

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,13 @@
433433
white-space: inherit;
434434
}
435435

436+
&:not(:has(.sub-menu.expanded-true)) {
437+
overflow-y: scroll;
438+
}
439+
436440
&.expanded-true {
437441

438-
display: table;
442+
display: block;
439443
margin-top: 0;
440444
opacity: 1;
441445
padding-left: 0;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3271,8 +3271,12 @@ body.page .main-navigation {
32713271
white-space: inherit;
32723272
}
32733273

3274+
.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu:not(:has(.sub-menu.expanded-true)) {
3275+
overflow-y: scroll;
3276+
}
3277+
32743278
.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true {
3275-
display: table;
3279+
display: block;
32763280
margin-top: 0;
32773281
opacity: 1;
32783282
padding-right: 0;

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3271,8 +3271,12 @@ body.page .main-navigation {
32713271
white-space: inherit;
32723272
}
32733273

3274+
.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu:not(:has(.sub-menu.expanded-true)) {
3275+
overflow-y: scroll;
3276+
}
3277+
32743278
.main-navigation .main-menu .menu-item-has-children.off-canvas .sub-menu.expanded-true {
3275-
display: table;
3279+
display: block;
32763280
margin-top: 0;
32773281
opacity: 1;
32783282
padding-left: 0;

src/wp-includes/author-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function get_the_author_posts() {
286286
if ( ! $post ) {
287287
return 0;
288288
}
289-
return count_user_posts( $post->post_author, $post->post_type );
289+
return (int) count_user_posts( $post->post_author, $post->post_type );
290290
}
291291

292292
/**

src/wp-includes/capabilities.php

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
470470
if ( $meta_key ) {
471471
$allowed = ! is_protected_meta( $meta_key, $object_type );
472472

473-
if ( ! empty( $object_subtype ) && has_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ) ) {
473+
if ( has_filter( "auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}" ) ) {
474474

475475
/**
476476
* Filters whether the user is allowed to edit a specific meta key of a specific object type and subtype.
@@ -512,36 +512,33 @@ function map_meta_cap( $cap, $user_id, ...$args ) {
512512
$allowed = apply_filters( "auth_{$object_type}_meta_{$meta_key}", $allowed, $meta_key, $object_id, $user_id, $cap, $caps );
513513
}
514514

515-
if ( ! empty( $object_subtype ) ) {
516-
517-
/**
518-
* Filters whether the user is allowed to edit meta for specific object types/subtypes.
519-
*
520-
* Return true to have the mapped meta caps from `edit_{$object_type}` apply.
521-
*
522-
* The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
523-
* The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered.
524-
* The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().
525-
*
526-
* @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`.
527-
* @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to
528-
* `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`.
529-
* @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead.
530-
*
531-
* @param bool $allowed Whether the user can add the object meta. Default false.
532-
* @param string $meta_key The meta key.
533-
* @param int $object_id Object ID.
534-
* @param int $user_id User ID.
535-
* @param string $cap Capability name.
536-
* @param string[] $caps Array of the user's capabilities.
537-
*/
538-
$allowed = apply_filters_deprecated(
539-
"auth_{$object_type}_{$object_subtype}_meta_{$meta_key}",
540-
array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),
541-
'4.9.8',
542-
"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}"
543-
);
544-
}
515+
/**
516+
* Filters whether the user is allowed to edit meta for specific object types/subtypes.
517+
*
518+
* Return true to have the mapped meta caps from `edit_{$object_type}` apply.
519+
*
520+
* The dynamic portion of the hook name, `$object_type` refers to the object type being filtered.
521+
* The dynamic portion of the hook name, `$object_subtype` refers to the object subtype being filtered.
522+
* The dynamic portion of the hook name, `$meta_key`, refers to the meta key passed to map_meta_cap().
523+
*
524+
* @since 4.6.0 As `auth_post_{$post_type}_meta_{$meta_key}`.
525+
* @since 4.7.0 Renamed from `auth_post_{$post_type}_meta_{$meta_key}` to
526+
* `auth_{$object_type}_{$object_subtype}_meta_{$meta_key}`.
527+
* @deprecated 4.9.8 Use {@see 'auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}'} instead.
528+
*
529+
* @param bool $allowed Whether the user can add the object meta. Default false.
530+
* @param string $meta_key The meta key.
531+
* @param int $object_id Object ID.
532+
* @param int $user_id User ID.
533+
* @param string $cap Capability name.
534+
* @param string[] $caps Array of the user's capabilities.
535+
*/
536+
$allowed = apply_filters_deprecated(
537+
"auth_{$object_type}_{$object_subtype}_meta_{$meta_key}",
538+
array( $allowed, $meta_key, $object_id, $user_id, $cap, $caps ),
539+
'4.9.8',
540+
"auth_{$object_type}_meta_{$meta_key}_for_{$object_subtype}"
541+
);
545542

546543
if ( ! $allowed ) {
547544
$caps[] = $cap;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ protected function update_size( $width = null, $height = null ) {
305305
* image operations within the time of the HTTP request.
306306
*
307307
* @since 6.2.0
308-
* @since 6.3.0 This method was deprecated.
308+
* @deprecated 6.3.0 No longer used in core.
309309
*
310310
* @return int|null The new limit on success, null on failure.
311311
*/

src/wp-includes/pluggable.php

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2676,9 +2676,11 @@ function wp_hash_password(
26762676
* - `PASSWORD_ARGON2ID`
26772677
* - `PASSWORD_DEFAULT`
26782678
*
2679+
* The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
2680+
*
26792681
* @since 6.8.0
26802682
*
2681-
* @param string $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant.
2683+
* @param string|int $algorithm The hashing algorithm. Default is the value of the `PASSWORD_BCRYPT` constant.
26822684
*/
26832685
$algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT );
26842686

@@ -2688,12 +2690,14 @@ function wp_hash_password(
26882690
* The default hashing algorithm is bcrypt, but this can be changed via the {@see 'wp_hash_password_algorithm'}
26892691
* filter. You must ensure that the options are appropriate for the algorithm in use.
26902692
*
2693+
* The values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
2694+
*
26912695
* @since 6.8.0
26922696
*
2693-
* @param array $options Array of options to pass to the password hashing functions.
2694-
* By default this is an empty array which means the default
2695-
* options will be used.
2696-
* @param string $algorithm The hashing algorithm in use.
2697+
* @param array $options Array of options to pass to the password hashing functions.
2698+
* By default this is an empty array which means the default
2699+
* options will be used.
2700+
* @param string|int $algorithm The hashing algorithm in use.
26972701
*/
26982702
$options = apply_filters( 'wp_hash_password_options', array(), $algorithm );
26992703

src/wp-includes/post.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4874,6 +4874,15 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
48744874
}
48754875
}
48764876

4877+
/**
4878+
* Fires immediately before a new post is inserted in the database.
4879+
*
4880+
* @since 6.9.0
4881+
*
4882+
* @param array $data Array of unslashed post data.
4883+
*/
4884+
do_action( 'pre_post_insert', $data );
4885+
48774886
if ( false === $wpdb->insert( $wpdb->posts, $data ) ) {
48784887
if ( $wp_error ) {
48794888
if ( 'attachment' === $post_type ) {
@@ -6868,7 +6877,9 @@ function wp_get_attachment_metadata( $attachment_id = 0, $unfiltered = false ) {
68686877
*
68696878
* @param int $attachment_id Attachment post ID.
68706879
* @param array $data Attachment meta data.
6871-
* @return int|false False if $post is invalid.
6880+
* @return int|bool Whether the metadata was successfully updated.
6881+
* True on success, the Meta ID if the key didn't exist.
6882+
* False if $post is invalid, on failure, or if $data is the same as the existing metadata.
68726883
*/
68736884
function wp_update_attachment_metadata( $attachment_id, $data ) {
68746885
$attachment_id = (int) $attachment_id;

src/wp-includes/rest-api/endpoints/class-wp-rest-settings-controller.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,18 @@ public function update_item( $request ) {
147147

148148
$params = $request->get_params();
149149

150+
if ( empty( $params ) || ! empty( array_diff_key( $params, $options ) ) ) {
151+
$message = empty( $params )
152+
? __( 'Request body cannot be empty.' )
153+
: __( 'Invalid parameter(s) provided.' );
154+
155+
return new WP_Error(
156+
'rest_invalid_param',
157+
$message,
158+
array( 'status' => 400 )
159+
);
160+
}
161+
150162
foreach ( $options as $name => $args ) {
151163
if ( ! array_key_exists( $name, $params ) ) {
152164
continue;

src/wp-includes/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ function count_user_posts( $userid, $post_type = 'post', $public_only = false )
637637
* @since 4.1.0 Added `$post_type` argument.
638638
* @since 4.3.1 Added `$public_only` argument.
639639
*
640-
* @param int $count The user's post count.
640+
* @param string $count The user's post count as a numeric string.
641641
* @param int $userid User ID.
642642
* @param string|array $post_type Single post type or array of post types to count the number of posts for.
643643
* @param bool $public_only Whether to limit counted posts to public posts.

0 commit comments

Comments
 (0)