diff --git a/wp-includes/block-editor.php b/wp-includes/block-editor.php index 1c67e6cc7a..901ba21a3f 100644 --- a/wp-includes/block-editor.php +++ b/wp-includes/block-editor.php @@ -153,9 +153,14 @@ function get_allowed_block_types( $block_editor_context ) { */ function get_default_block_editor_settings() { // Media settings. - $max_upload_size = wp_max_upload_size(); - if ( ! $max_upload_size ) { - $max_upload_size = 0; + + // wp_max_upload_size() can be expensive, so only call it when relevant for the current user. + $max_upload_size = 0; + if ( current_user_can( 'upload_files' ) ) { + $max_upload_size = wp_max_upload_size(); + if ( ! $max_upload_size ) { + $max_upload_size = 0; + } } /** This filter is documented in wp-admin/includes/media.php */ diff --git a/wp-includes/version.php b/wp-includes/version.php index e93cd3ce4c..28bf2a8eb5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-54768'; +$wp_version = '6.2-alpha-54769'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.