From b330629c5360c7bd450ed18cd67e03e228272938 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 2 Nov 2023 00:04:24 +0000 Subject: [PATCH] Coding Standards: Correct equals sign alignment in various files. This resolves a few WPCS warnings: {{{ Equals sign not aligned with surrounding statements }}} so that the output of `composer format` is clean. Follow-up to [56796], [56803], [56838], [56839], [56985]. See #59650. Built from https://develop.svn.wordpress.org/trunk@57053 git-svn-id: http://core.svn.wordpress.org/trunk@56564 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/blocks.php | 2 +- wp-includes/class-wp-block-list.php | 3 ++- wp-includes/media.php | 4 ++-- wp-includes/option.php | 7 +++++++ wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | 1 + wp-includes/version.php | 2 +- 6 files changed, 14 insertions(+), 5 deletions(-) diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index 52b20b3e55..18cc02a6ff 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -1970,7 +1970,7 @@ function get_comments_pagination_arrow( $block, $pagination_type = 'next' ) { * @return string Filtered content without any HTML on the footnote content and with the sanitized id. */ function _wp_filter_post_meta_footnotes( $footnotes ) { - $footnotes_decoded = json_decode( $footnotes, true ); + $footnotes_decoded = json_decode( $footnotes, true ); if ( ! is_array( $footnotes_decoded ) ) { return ''; } diff --git a/wp-includes/class-wp-block-list.php b/wp-includes/class-wp-block-list.php index 4e30f1c5f9..e1151e6745 100644 --- a/wp-includes/class-wp-block-list.php +++ b/wp-includes/class-wp-block-list.php @@ -93,7 +93,8 @@ class WP_Block_List implements Iterator, ArrayAccess, Countable { $block = $this->blocks[ $offset ]; if ( isset( $block ) && is_array( $block ) ) { - $block = new WP_Block( $block, $this->available_context, $this->registry ); + $block = new WP_Block( $block, $this->available_context, $this->registry ); + $this->blocks[ $offset ] = $block; } diff --git a/wp-includes/media.php b/wp-includes/media.php index 31bbecc0b7..96c303894d 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2608,7 +2608,7 @@ function gallery_shortcode( $attr ) { } } elseif ( ! empty( $atts['exclude'] ) ) { $post_parent_id = $id; - $attachments = get_children( + $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], @@ -2621,7 +2621,7 @@ function gallery_shortcode( $attr ) { ); } else { $post_parent_id = $id; - $attachments = get_children( + $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', diff --git a/wp-includes/option.php b/wp-includes/option.php index 13f5d49c87..73b38c6514 100644 --- a/wp-includes/option.php +++ b/wp-includes/option.php @@ -475,11 +475,13 @@ function wp_set_option_autoload_values( array $options ) { wp_cache_delete( 'alloptions', 'options' ); } elseif ( $grouped_options['no'] ) { $alloptions = wp_load_alloptions( true ); + foreach ( $grouped_options['no'] as $option ) { if ( isset( $alloptions[ $option ] ) ) { unset( $alloptions[ $option ] ); } } + wp_cache_set( 'alloptions', $alloptions, 'options' ); } @@ -843,6 +845,7 @@ function update_option( $option, $value, $autoload = null ) { if ( ! isset( $update_args['autoload'] ) ) { // Update the cached value based on where it is currently cached. $alloptions = wp_load_alloptions( true ); + if ( isset( $alloptions[ $option ] ) ) { $alloptions[ $option ] = $serialized_value; wp_cache_set( 'alloptions', $alloptions, 'options' ); @@ -854,11 +857,13 @@ function update_option( $option, $value, $autoload = null ) { wp_cache_delete( $option, 'options' ); $alloptions = wp_load_alloptions( true ); + $alloptions[ $option ] = $serialized_value; wp_cache_set( 'alloptions', $alloptions, 'options' ); } else { // Delete the alloptions cache, then set the individual cache. $alloptions = wp_load_alloptions( true ); + if ( isset( $alloptions[ $option ] ) ) { unset( $alloptions[ $option ] ); wp_cache_set( 'alloptions', $alloptions, 'options' ); @@ -1089,6 +1094,7 @@ function delete_option( $option ) { if ( ! wp_installing() ) { if ( 'yes' === $row->autoload ) { $alloptions = wp_load_alloptions( true ); + if ( is_array( $alloptions ) && isset( $alloptions[ $option ] ) ) { unset( $alloptions[ $option ] ); wp_cache_set( 'alloptions', $alloptions, 'options' ); @@ -1216,6 +1222,7 @@ function get_transient( $transient ) { if ( ! wp_installing() ) { // If option is not in alloptions, it is not autoloaded and thus has a timeout. $alloptions = wp_load_alloptions(); + if ( ! isset( $alloptions[ $transient_option ] ) ) { $transient_timeout = '_transient_timeout_' . $transient; $timeout = get_option( $transient_timeout ); diff --git a/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php b/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php index 581b4ca2a3..7436f5ff00 100644 --- a/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php +++ b/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php @@ -131,6 +131,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider { if ( ! empty( $latest_posts->posts ) ) { $posts = wp_list_sort( $latest_posts->posts, 'post_modified_gmt', 'DESC' ); + $sitemap_entry['lastmod'] = wp_date( DATE_W3C, strtotime( $posts[0]->post_modified_gmt ) ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2dbb3c4128..d587741470 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.5-alpha-57052'; +$wp_version = '6.5-alpha-57053'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.