Skip to content

Commit

Permalink
Added missing custom class in latest posts block. (WordPress#6311)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgefilipecosta authored and nuzzio committed Apr 25, 2018
1 parent 7b0283e commit 0386249
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions blocks/library/categories/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ function render_block_core_categories( $attributes ) {

$class = "wp-block-categories wp-block-categories-{$type} align{$align}";

if ( isset( $attributes['className'] ) ) {
$class .= ' ' . $attributes['className'];
}

$block_content = sprintf(
$wrapper_markup,
esc_attr( $class ),
Expand Down
7 changes: 7 additions & 0 deletions blocks/library/latest-posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function render_block_core_latest_posts( $attributes ) {
$class .= ' columns-' . $attributes['columns'];
}

if ( isset( $attributes['className'] ) ) {
$class .= ' ' . $attributes['className'];
}

$block_content = sprintf(
'<ul class="%1$s">%2$s</ul>',
esc_attr( $class ),
Expand All @@ -74,6 +78,9 @@ function register_block_core_latest_posts() {
'categories' => array(
'type' => 'string',
),
'className' => array(
'type' => 'string',
),
'postsToShow' => array(
'type' => 'number',
'default' => 5,
Expand Down

0 comments on commit 0386249

Please sign in to comment.