From 2fc2afb107785f0197e1324fa380e3a0b382cdd1 Mon Sep 17 00:00:00 2001 From: Riad Benguella Date: Fri, 21 May 2021 15:56:31 +0000 Subject: [PATCH] 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 --- src/wp-includes/blocks.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 3c6a9cdf99..26f82f8624 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -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. *