Skip to content

Commit

Permalink
Coding Standards: Correct equals sign alignment in various files.
Browse files Browse the repository at this point in the history
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.

git-svn-id: https://develop.svn.wordpress.org/trunk@57053 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Nov 2, 2023
1 parent 2e6a235 commit 7500889
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 '';
}
Expand Down
3 changes: 2 additions & 1 deletion src/wp-includes/class-wp-block-list.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ public function offsetGet( $offset ) {
$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;
}

Expand Down
4 changes: 2 additions & 2 deletions src/wp-includes/media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand All @@ -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',
Expand Down
7 changes: 7 additions & 0 deletions src/wp-includes/option.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

Expand Down Expand Up @@ -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' );
Expand All @@ -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' );
Expand Down Expand Up @@ -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' );
Expand Down Expand Up @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ public function get_url_list( $page_num, $object_subtype = '' ) {

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 ) );
}

Expand Down

0 comments on commit 7500889

Please sign in to comment.