$more_text = ! empty($attributes['moreText']) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url(get_the_permalink($block->context['postId'])) . '">' . wp_kses_post($attributes['moreText']) . '</a>' : ''; $filter_excerpt_more = staticfunction($more)use($more_text){ returnempty($more_text) ? $more : ''; }; /**
* Some themes might use `excerpt_more` filter to handle the
* `more` link displayed after a trimmed excerpt. Since the
* block has a `more text` attribute we have to check and
* override if needed the return value from this filter.
* So if the block's attribute is not empty override the
* `excerpt_more` filter and return nothing. This will
* result in showing only one `read more` link at a time.
*/