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.

Built from https://develop.svn.wordpress.org/trunk@50950


git-svn-id: http://core.svn.wordpress.org/trunk@50559 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
youknowriad 2021-05-21 15:57:56 +00:00
parent 5ddc1fb946
commit e0d91e047b
2 changed files with 2 additions and 10 deletions

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.
*

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50949';
$wp_version = '5.8-alpha-50950';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.