wip
This commit is contained in:
@@ -10,14 +10,22 @@
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @param array $attributes Block attributes.
|
||||
* @param array $attributes Block attributes.
|
||||
* @param string $content Block default content.
|
||||
* @param WP_Block $block Block instance.
|
||||
*
|
||||
* @return string Returns the description of the current taxonomy term, if available
|
||||
*/
|
||||
function render_block_core_term_description( $attributes ) {
|
||||
function render_block_core_term_description( $attributes, $content, $block ) {
|
||||
$term_description = '';
|
||||
|
||||
if ( is_category() || is_tag() || is_tax() ) {
|
||||
// Get term from context or from the current query.
|
||||
if ( isset( $block->context['termId'] ) && isset( $block->context['taxonomy'] ) ) {
|
||||
$term = get_term( $block->context['termId'], $block->context['taxonomy'] );
|
||||
if ( $term && ! is_wp_error( $term ) ) {
|
||||
$term_description = $term->description;
|
||||
}
|
||||
} elseif ( is_category() || is_tag() || is_tax() ) {
|
||||
$term_description = term_description();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user