Skip to content

Commit

Permalink
Check if the placeholder is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
carolinan committed Apr 19, 2021
1 parent adfabad commit fe97489
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/block-library/src/post-excerpt/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
return '';
}

$more_text = isset( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . $attributes['moreText'] . '</a>' : '';
$more_text = isset( $attributes['moreText'] ) && '' !== $attributes['moreText'] ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . $attributes['moreText'] . '</a>' : '';

$filter_excerpt_length = function() use ( $attributes ) {
return isset( $attributes['wordCount'] ) ? $attributes['wordCount'] : 55;
Expand Down

0 comments on commit fe97489

Please sign in to comment.