Skip to content

Commit

Permalink
Update to WordPress 6.3.1. For more information, see https://wordpres…
Browse files Browse the repository at this point in the history
  • Loading branch information
Pantheon Automation authored and pwtyler committed Aug 29, 2023
1 parent cecd3a5 commit ecae275
Show file tree
Hide file tree
Showing 19 changed files with 438 additions and 333 deletions.
31 changes: 31 additions & 0 deletions wp-admin/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@
<a href="privacy.php" class="nav-tab"><?php _e( 'Privacy' ); ?></a>
<a href="contribute.php" class="nav-tab"><?php _e( 'Get Involved' ); ?></a>
</nav>

<div class="about__section changelog has-subtle-background-color">
<div class="column">
<h2><?php _e( 'Maintenance Release' ); ?></h2>
<p>
<?php
printf(
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
_n(
'<strong>Version %1$s</strong> addressed %2$s bug.',
'<strong>Version %1$s</strong> addressed %2$s bugs.',
10
),
'6.3.1',
'10'
);
?>
<?php
printf(
/* translators: %s: HelpHub URL. */
__( 'For more information, see <a href="%s">the release notes</a>.' ),
sprintf(
/* translators: %s: WordPress version. */
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
sanitize_title( '6.3.1' )
)
);
?>
</p>
</div>
</div>

<div class="about__section aligncenter">
<div class="column">
Expand Down
18 changes: 5 additions & 13 deletions wp-admin/includes/class-wp-site-health.php
Original file line number Diff line number Diff line change
Expand Up @@ -1943,10 +1943,6 @@ public function get_test_plugin_theme_auto_updates() {
public function get_test_available_updates_disk_space() {
$available_space = function_exists( 'disk_free_space' ) ? @disk_free_space( WP_CONTENT_DIR . '/upgrade/' ) : false;

$available_space = false !== $available_space
? (int) $available_space
: 0;

$result = array(
'label' => __( 'Disk space available to safely perform updates' ),
'status' => 'good',
Expand All @@ -1963,18 +1959,14 @@ public function get_test_available_updates_disk_space() {
'test' => 'available_updates_disk_space',
);

if ( $available_space < 100 * MB_IN_BYTES ) {
$result['description'] = __( 'Available disk space is low, less than 100 MB available.' );
if ( false === $available_space ) {
$result['description'] = __( 'Could not determine available disk space for updates.' );
$result['status'] = 'recommended';
}

if ( $available_space < 20 * MB_IN_BYTES ) {
} elseif ( $available_space < 20 * MB_IN_BYTES ) {
$result['description'] = __( 'Available disk space is critically low, less than 20 MB available. Proceed with caution, updates may fail.' );
$result['status'] = 'critical';
}

if ( ! $available_space ) {
$result['description'] = __( 'Could not determine available disk space for updates.' );
} elseif ( $available_space < 100 * MB_IN_BYTES ) {
$result['description'] = __( 'Available disk space is low, less than 100 MB available.' );
$result['status'] = 'recommended';
}

Expand Down
8 changes: 6 additions & 2 deletions wp-admin/includes/update-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -1431,9 +1431,13 @@ function update_core( $from, $to ) {
} else {
$lang_dir = WP_CONTENT_DIR . '/languages';
}

/*
* Note: str_starts_with() is not used here, as this file is included
* when updating from older WordPress versions, in which case
* the polyfills from wp-includes/compat.php may not be available.
*/
// Check if the language directory exists first.
if ( ! @is_dir( $lang_dir ) && str_starts_with( $lang_dir, ABSPATH ) ) {
if ( ! @is_dir( $lang_dir ) && 0 === strpos( $lang_dir, ABSPATH ) ) {
// If it's within the ABSPATH we can handle it here, otherwise they're out of luck.
$wp_filesystem->mkdir( $to . str_replace( ABSPATH, '', $lang_dir ), FS_CHMOD_DIR );
clearstatcache(); // For FTP, need to clear the stat cache.
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.min.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion wp-includes/assets/script-loader-packages.php

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions wp-includes/blocks/footnotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function render_block_core_footnotes( $attributes, $content, $block ) {

$footnotes = json_decode( $footnotes, true );

if ( count( $footnotes ) === 0 ) {
if ( ! is_array( $footnotes ) || count( $footnotes ) === 0 ) {
return '';
}

Expand Down Expand Up @@ -98,7 +98,7 @@ function wp_save_footnotes_meta( $revision_id ) {

if ( $footnotes ) {
// Can't use update_post_meta() because it doesn't allow revisions.
update_metadata( 'post', $revision_id, 'footnotes', $footnotes );
update_metadata( 'post', $revision_id, 'footnotes', wp_slash( $footnotes ) );
}
}
}
Expand Down Expand Up @@ -154,15 +154,14 @@ function wp_add_footnotes_revisions_to_post_meta( $post ) {

if ( $footnotes ) {
// Can't use update_post_meta() because it doesn't allow revisions.
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', $footnotes );
update_metadata( 'post', $wp_temporary_footnote_revision_id, 'footnotes', wp_slash( $footnotes ) );
}
}
}
}

foreach ( array( 'post', 'page' ) as $post_type ) {
add_action( "rest_after_insert_{$post_type}", 'wp_add_footnotes_revisions_to_post_meta' );
}
add_action( 'rest_after_insert_post', 'wp_add_footnotes_revisions_to_post_meta' );
add_action( 'rest_after_insert_page', 'wp_add_footnotes_revisions_to_post_meta' );

/**
* Restores the footnotes meta value from the revision.
Expand All @@ -176,7 +175,7 @@ function wp_restore_footnotes_from_revision( $post_id, $revision_id ) {
$footnotes = get_post_meta( $revision_id, 'footnotes', true );

if ( $footnotes ) {
update_post_meta( $post_id, 'footnotes', $footnotes );
update_post_meta( $post_id, 'footnotes', wp_slash( $footnotes ) );
} else {
delete_post_meta( $post_id, 'footnotes' );
}
Expand Down Expand Up @@ -243,7 +242,7 @@ function _wp_rest_api_autosave_meta( $autosave ) {
return;
}

update_post_meta( $id, 'footnotes', $body['meta']['footnotes'] );
update_post_meta( $id, 'footnotes', wp_slash( $body['meta']['footnotes'] ) );
}
// See https://github.com/WordPress/wordpress-develop/blob/2103cb9966e57d452c94218bbc3171579b536a40/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php#L391C1-L391C1.
add_action( 'wp_creating_autosave', '_wp_rest_api_autosave_meta' );
Expand Down
6 changes: 4 additions & 2 deletions wp-includes/class-wp-classic-to-block-menu-converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ class WP_Classic_To_Block_Menu_Converter {
* @since 6.3.0
*
* @param WP_Term $menu The Menu term object of the menu to convert.
* @return string the serialized and normalized parsed blocks.
* @return string|WP_Error The serialized and normalized parsed blocks on success,
* an empty string when there are no menus to convert,
* or WP_Error on invalid menu.
*/
public static function convert( $menu ) {

Expand All @@ -34,7 +36,7 @@ public static function convert( $menu ) {
$menu_items = wp_get_nav_menu_items( $menu->term_id, array( 'update_post_term_cache' => false ) );

if ( empty( $menu_items ) ) {
return array();
return '';
}

// Set up the $menu_item variables.
Expand Down
4 changes: 4 additions & 0 deletions wp-includes/class-wp-navigation-fallback.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ private static function create_classic_menu_fallback() {
// If there is a classic menu then convert it to blocks.
$classic_nav_menu_blocks = WP_Classic_To_Block_Menu_Converter::convert( $classic_nav_menu );

if ( is_wp_error( $classic_nav_menu_blocks ) ) {
return $classic_nav_menu_blocks;
}

if ( empty( $classic_nav_menu_blocks ) ) {
return new WP_Error( 'cannot_convert_classic_menu', __( 'Unable to convert Classic Menu to blocks.' ) );
}
Expand Down
7 changes: 5 additions & 2 deletions wp-includes/class-wp-user-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -1071,12 +1071,15 @@ protected function generate_cache_key( array $args, $sql ) {
if ( isset( $args['blog_id'] ) ) {
$blog_id = absint( $args['blog_id'] );
}
if ( ( $args['has_published_posts'] && $blog_id ) || in_array( 'post_count', $ordersby, true ) ) {
$switch = get_current_blog_id() !== $blog_id;

if ( $args['has_published_posts'] || in_array( 'post_count', $ordersby, true ) ) {
$switch = $blog_id && get_current_blog_id() !== $blog_id;
if ( $switch ) {
switch_to_blog( $blog_id );
}

$last_changed .= wp_cache_get_last_changed( 'posts' );

if ( $switch ) {
restore_current_blog();
}
Expand Down
11 changes: 10 additions & 1 deletion wp-includes/js/dist/block-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -46279,6 +46279,8 @@ function useClipboardHandler() {
if (shouldHandleWholeBlocks && !expandSelectionIsNeeded) {
removeBlocks(selectedBlockClientIds);
} else {
event.target.ownerDocument.activeElement.contentEditable = false;

__unstableDeleteSelection();
}
} else if (event.type === 'paste') {
Expand Down Expand Up @@ -56118,7 +56120,14 @@ function RichTextWrapper({
}), anchorRef]),
contentEditable: true,
suppressContentEditableWarning: true,
className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text')
className: classnames_default()('block-editor-rich-text__editable', props.className, 'rich-text') // Setting tabIndex to 0 is unnecessary, the element is already
// focusable because it's contentEditable. This also fixes a
// Safari bug where it's not possible to Shift+Click multi
// select blocks when Shift Clicking into an element with
// tabIndex because Safari will focus the element. However,
// Safari will correctly ignore nested contentEditable elements.
,
tabIndex: props.tabIndex === 0 ? null : props.tabIndex
}));
}

Expand Down
4 changes: 2 additions & 2 deletions wp-includes/js/dist/block-editor.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit ecae275

Please sign in to comment.