WordPress.org

Make WordPress Core

Changeset 50950


Ignore:
Timestamp:
05/21/2021 03:56:31 PM (5 months ago)
Author:
youknowriad
Message:

Block Editor: Removed useless block editor render context value.

The "query" context value was meant to be used by the Query block.
But the block has been refactored to avoid relying on context for this.

Props ntsekouras.
Fixes #53250.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks.php

    r50945 r50950  
    764764 *
    765765 * @global WP_Post  $post     The post to edit.
    766  * @global WP_Query $wp_query WordPress Query object.
    767766 *
    768767 * @param array $parsed_block A single parsed block object.
     
    770769 */
    771770function render_block( $parsed_block ) {
    772     global $post, $wp_query;
     771    global $post;
    773772
    774773    /**
     
    811810    }
    812811
    813     if ( $wp_query instanceof WP_Query && isset( $wp_query->tax_query->queried_terms['category'] ) ) {
    814         $context['query'] = array( 'categoryIds' => array() );
    815         foreach ( $wp_query->tax_query->queried_terms['category']['terms'] as $category_slug_or_id ) {
    816             $context['query']['categoryIds'][] = 'slug' === $wp_query->tax_query->queried_terms['category']['field'] ? get_cat_ID( $category_slug_or_id ) : $category_slug_or_id;
    817         }
    818     }
    819 
    820812    /**
    821813     * Filters the default context provided to a rendered block.
Note: See TracChangeset for help on using the changeset viewer.