Edit File by line
/home/zeestwma/richards.../wp-inclu.../blocks
File: term-description.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* Server-side rendering of the `core/term-description` block.
[2] Fix | Delete
*
[3] Fix | Delete
* @package WordPress
[4] Fix | Delete
*/
[5] Fix | Delete
[6] Fix | Delete
/**
[7] Fix | Delete
* Renders the `core/term-description` block on the server.
[8] Fix | Delete
*
[9] Fix | Delete
* @since 5.9.0
[10] Fix | Delete
*
[11] Fix | Delete
* @param array $attributes Block attributes.
[12] Fix | Delete
*
[13] Fix | Delete
* @return string Returns the description of the current taxonomy term, if available
[14] Fix | Delete
*/
[15] Fix | Delete
function render_block_core_term_description( $attributes ) {
[16] Fix | Delete
$term_description = '';
[17] Fix | Delete
[18] Fix | Delete
if ( is_category() || is_tag() || is_tax() ) {
[19] Fix | Delete
$term_description = term_description();
[20] Fix | Delete
}
[21] Fix | Delete
[22] Fix | Delete
if ( empty( $term_description ) ) {
[23] Fix | Delete
return '';
[24] Fix | Delete
}
[25] Fix | Delete
[26] Fix | Delete
$classes = array();
[27] Fix | Delete
if ( isset( $attributes['textAlign'] ) ) {
[28] Fix | Delete
$classes[] = 'has-text-align-' . $attributes['textAlign'];
[29] Fix | Delete
}
[30] Fix | Delete
if ( isset( $attributes['style']['elements']['link']['color']['text'] ) ) {
[31] Fix | Delete
$classes[] = 'has-link-color';
[32] Fix | Delete
}
[33] Fix | Delete
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classes ) ) );
[34] Fix | Delete
[35] Fix | Delete
return '<div ' . $wrapper_attributes . '>' . $term_description . '</div>';
[36] Fix | Delete
}
[37] Fix | Delete
[38] Fix | Delete
/**
[39] Fix | Delete
* Registers the `core/term-description` block on the server.
[40] Fix | Delete
*
[41] Fix | Delete
* @since 5.9.0
[42] Fix | Delete
*/
[43] Fix | Delete
function register_block_core_term_description() {
[44] Fix | Delete
register_block_type_from_metadata(
[45] Fix | Delete
__DIR__ . '/term-description',
[46] Fix | Delete
array(
[47] Fix | Delete
'render_callback' => 'render_block_core_term_description',
[48] Fix | Delete
)
[49] Fix | Delete
);
[50] Fix | Delete
}
[51] Fix | Delete
add_action( 'init', 'register_block_core_term_description' );
[52] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function