Changeset 61009 for trunk/src/wp-includes/blocks/term-description.php
- Timestamp:
- 10/21/2025 07:11:53 AM (3 months ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/blocks/term-description.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/term-description.php
r58187 r61009 11 11 * @since 5.9.0 12 12 * 13 * @param array $attributes Block attributes. 13 * @param array $attributes Block attributes. 14 * @param string $content Block default content. 15 * @param WP_Block $block Block instance. 14 16 * 15 17 * @return string Returns the description of the current taxonomy term, if available 16 18 */ 17 function render_block_core_term_description( $attributes ) {19 function render_block_core_term_description( $attributes, $content, $block ) { 18 20 $term_description = ''; 19 21 20 if ( is_category() || is_tag() || is_tax() ) { 22 // Get term from context or from the current query. 23 if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) { 24 $term = get_term( $block->context['termId'], $block->context['taxonomy'] ); 25 if ( $term && ! is_wp_error( $term ) ) { 26 $term_description = $term->description; 27 } 28 } elseif ( is_category() || is_tag() || is_tax() ) { 21 29 $term_description = term_description(); 22 30 }
Note: See TracChangeset
for help on using the changeset viewer.