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.


git-svn-id: https://develop.svn.wordpress.org/trunk@50950 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Riad Benguella 2021-05-21 15:56:31 +00:00
parent 62327715a0
commit 2fc2afb107

View File

@ -763,13 +763,12 @@ function _excerpt_render_inner_columns_blocks( $columns, $allowed_blocks ) {
* @since 5.0.0
*
* @global WP_Post $post The post to edit.
* @global WP_Query $wp_query WordPress Query object.
*
* @param array $parsed_block A single parsed block object.
* @return string String of rendered HTML.
*/
function render_block( $parsed_block ) {
global $post, $wp_query;
global $post;
/**
* Allows render_block() to be short-circuited, by returning a non-null value.
@ -810,13 +809,6 @@ function render_block( $parsed_block ) {
$context['postType'] = $post->post_type;
}
if ( $wp_query instanceof WP_Query && isset( $wp_query->tax_query->queried_terms['category'] ) ) {
$context['query'] = array( 'categoryIds' => array() );
foreach ( $wp_query->tax_query->queried_terms['category']['terms'] as $category_slug_or_id ) {
$context['query']['categoryIds'][] = 'slug' === $wp_query->tax_query->queried_terms['category']['field'] ? get_cat_ID( $category_slug_or_id ) : $category_slug_or_id;
}
}
/**
* Filters the default context provided to a rendered block.
*