Skip to content

Commit

Permalink
Fix archives block render function (#26309)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Oct 22, 2020
1 parent bfe6060 commit d5f194f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/block-library/src/archives/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,16 @@ function render_block_core_archives( $attributes ) {

$classnames = esc_attr( $class );

if ( empty( $archives ) ) {
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );

if ( empty( $archives ) ) {
return sprintf(
'<div class="%1$s">%2$s</div>',
$classnames,
'<div %1$s>%2$s</div>',
$wrapper_attributes,
__( 'No archives to show.' )
);
}

$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classnames ) );

return sprintf(
'<ul %1$s>%2$s</ul>',
$wrapper_attributes,
Expand Down

0 comments on commit d5f194f

Please sign in to comment.