Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Make Archives Block display correct empty message #9419
When creating an Archives Block while having no posts published, the
This addresses that by setting the correct Block content when there
How has this been tested?
Built in tests and manually
Types of changes
Bug fix (non-breaking change which fixes an issue)
@caxco93: Thanks for the PR!
It seems like this could be simplified further: rather than duplicating the
$block_content = sprintf( '<ul class="%1$s">%2$s</ul>', esc_attr( $class ), $archives ? $archives : __( 'No archives to show.', 'gutenberg' ) );
Yeah it could be simplified with something along those lines, but with that example you gave we would have an
This was actually based on a similar implementation for the empty Comments Block, but now that you point this out, I think that we should stick to a simple
what do you think @pento ?