Changeset 50950
- Timestamp:
- 05/21/2021 03:56:31 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r50945 r50950 764 764 * 765 765 * @global WP_Post $post The post to edit. 766 * @global WP_Query $wp_query WordPress Query object.767 766 * 768 767 * @param array $parsed_block A single parsed block object. … … 770 769 */ 771 770 function render_block( $parsed_block ) { 772 global $post , $wp_query;771 global $post; 773 772 774 773 /** … … 811 810 } 812 811 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 820 812 /** 821 813 * Filters the default context provided to a rendered block.
Note: See TracChangeset
for help on using the changeset viewer.