diff --git a/wp-includes/capabilities.php b/wp-includes/capabilities.php index 42e07a471d..d6c340c95e 100644 --- a/wp-includes/capabilities.php +++ b/wp-includes/capabilities.php @@ -825,8 +825,13 @@ function map_meta_cap( $cap, $user_id, ...$args ) { $caps[] = 'do_not_allow'; break; } - - $caps = map_meta_cap( "edit_{$object_subtype}", $user_id, $object_id ); + $post_type_object = get_post_type_object( $object_subtype ); + // Initialize empty array if it doesn't exist. + if ( ! isset( $post_type_object->capabilities ) ) { + $post_type_object->capabilities = array(); + } + $post_type_capabilities = get_post_type_capabilities( $post_type_object ); + $caps = map_meta_cap( $post_type_capabilities->edit_post, $user_id, $object_id ); break; default: // Handle meta capabilities for custom post types. diff --git a/wp-includes/version.php b/wp-includes/version.php index 984bd55268..46cc56a966 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-beta3-59238'; +$wp_version = '6.7-beta3-59239'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.