equal
deleted
inserted
replaced
77 } |
77 } |
78 |
78 |
79 $list_items .= "<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>"; |
79 $list_items .= "<li class='wp-block-rss__item'>{$title}{$date}{$author}{$excerpt}</li>"; |
80 } |
80 } |
81 |
81 |
82 $class = 'wp-block-rss'; |
82 $classnames = array(); |
83 if ( isset( $attributes['align'] ) ) { |
|
84 $class .= ' align' . $attributes['align']; |
|
85 } |
|
86 |
|
87 if ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) { |
83 if ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) { |
88 $class .= ' is-grid'; |
84 $classnames[] = 'is-grid'; |
89 } |
85 } |
90 |
86 |
91 if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) { |
87 if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) { |
92 $class .= ' columns-' . $attributes['columns']; |
88 $classnames[] = 'columns-' . $attributes['columns']; |
93 } |
89 } |
|
90 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); |
94 |
91 |
95 if ( isset( $attributes['className'] ) ) { |
92 return sprintf( '<ul %s>%s</ul>', $wrapper_attributes, $list_items ); |
96 $class .= ' ' . $attributes['className']; |
|
97 } |
|
98 |
|
99 return sprintf( '<ul class="%s">%s</ul>', esc_attr( $class ), $list_items ); |
|
100 } |
93 } |
101 |
94 |
102 /** |
95 /** |
103 * Registers the `core/rss` block on server. |
96 * Registers the `core/rss` block on server. |
104 */ |
97 */ |