diff --git a/packages/block-library/src/rss/index.php b/packages/block-library/src/rss/index.php
index b5fe3abaf563be..006cffcb081c22 100644
--- a/packages/block-library/src/rss/index.php
+++ b/packages/block-library/src/rss/index.php
@@ -79,8 +79,17 @@ function render_block_core_rss( $attributes ) {
$list_items .= "
";
}
- $classes = 'grid' === $attributes['blockLayout'] ? ' is-grid columns-' . $attributes['columns'] : '';
- $list_items_markup = "";
+ $class = 'wp-block-rss';
+
+ if ( 'grid' === $attributes['blockLayout'] ) {
+ $class .= ' is-grid columns-' . $attributes['columns'];
+ }
+
+ if ( ! empty( $attributes['className'] ) ) {
+ $class .= ' ' . $attributes['className'];
+ }
+
+ $list_items_markup = "";
// PHP 5.2 compatibility. See: http://simplepie.org/wiki/faq/i_m_getting_memory_leaks.
$rss->__destruct();
@@ -96,31 +105,26 @@ function register_block_core_rss() {
register_block_type( 'core/rss',
array(
'attributes' => array(
- 'columns' => array(
- 'type' => 'number',
- 'default' => 2,
- ),
'blockLayout' => array(
'type' => 'string',
'default' => 'list',
),
- 'feedURL' => array(
- 'type' => 'string',
- 'default' => '',
+ 'className' => array(
+ 'type' => 'string',
),
- 'itemsToShow' => array(
+ 'columns' => array(
'type' => 'number',
- 'default' => 5,
+ 'default' => 2,
),
- 'displayExcerpt' => array(
+ 'displayAuthor' => array(
'type' => 'boolean',
'default' => false,
),
- 'displayAuthor' => array(
+ 'displayDate' => array(
'type' => 'boolean',
'default' => false,
),
- 'displayDate' => array(
+ 'displayExcerpt' => array(
'type' => 'boolean',
'default' => false,
),
@@ -128,6 +132,14 @@ function register_block_core_rss() {
'type' => 'number',
'default' => 55,
),
+ 'feedURL' => array(
+ 'type' => 'string',
+ 'default' => '',
+ ),
+ 'itemsToShow' => array(
+ 'type' => 'number',
+ 'default' => 5,
+ ),
),
'render_callback' => 'render_block_core_rss',
)