Skip to content
1 change: 1 addition & 0 deletions packages/block-editor/src/hooks/align.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export function addAttribute( settings ) {
...settings.attributes,
align: {
type: 'string',
enum: ALL_ALIGNMENTS,
},
};
}
Expand Down
10 changes: 0 additions & 10 deletions packages/block-library/src/archives/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
"name": "core/archives",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [
"left",
"center",
"right",
"wide",
"full"
]
},
"className": {
"type": "string"
},
Expand Down
6 changes: 5 additions & 1 deletion packages/block-library/src/archives/edit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
* External dependencies
*/
import { omit } from 'lodash';
/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -36,7 +40,7 @@ export default function ArchivesEdit( { attributes, setAttributes } ) {
<Disabled>
<ServerSideRender
block="core/archives"
attributes={ attributes }
attributes={ omit( attributes, [ 'align' ] ) }
/>
</Disabled>
</>
Expand Down
4 changes: 0 additions & 4 deletions packages/block-library/src/archives/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ function render_block_core_archives( $attributes ) {

$class = 'wp-block-archives';

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

if ( isset( $attributes['className'] ) ) {
$class .= " {$attributes['className']}";
}
Expand Down
10 changes: 0 additions & 10 deletions packages/block-library/src/calendar/block.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
"name": "core/calendar",
"category": "widgets",
"attributes": {
"align": {
"type": "string",
"enum": [
"left",
"center",
"right",
"wide",
"full"
]
},
"className": {
"type": "string"
},
Expand Down
3 changes: 2 additions & 1 deletion packages/block-library/src/calendar/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
import moment from 'moment';
import memoize from 'memize';
import { omit } from 'lodash';

/**
* WordPress dependencies
Expand Down Expand Up @@ -39,7 +40,7 @@ class CalendarEdit extends Component {

getServerSideAttributes( attributes, date ) {
return {
...attributes,
...omit( attributes, [ 'align' ] ),
...this.getYearMonth( date ),
};
}
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/calendar/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ function render_block_core_calendar( $attributes ) {
}

$custom_class_name = empty( $attributes['className'] ) ? '' : ' ' . $attributes['className'];
$align_class_name = empty( $attributes['align'] ) ? '' : ' ' . "align{$attributes['align']}";

$output = sprintf(
'<div class="%1$s">%2$s</div>',
esc_attr( 'wp-block-calendar' . $custom_class_name . $align_class_name ),
esc_attr( 'wp-block-calendar' . $custom_class_name ),
get_calendar( true, false )
);

Expand Down
4 changes: 0 additions & 4 deletions packages/block-library/src/categories/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@ function render_block_core_categories( $attributes ) {

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

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

if ( isset( $attributes['className'] ) ) {
$class .= " {$attributes['className']}";
}
Expand Down
3 changes: 0 additions & 3 deletions packages/block-library/src/latest-comments/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ function render_block_core_latest_comments( $attributes = array() ) {
if ( ! empty( $attributes['className'] ) ) {
$class .= ' ' . $attributes['className'];
}
if ( isset( $attributes['align'] ) ) {
$class .= " align{$attributes['align']}";
}
if ( $attributes['displayAvatar'] ) {
$class .= ' has-avatars';
}
Expand Down
3 changes: 0 additions & 3 deletions packages/block-library/src/latest-posts/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ function render_block_core_latest_posts( $attributes ) {
remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );

$class = 'wp-block-latest-posts wp-block-latest-posts__list';
if ( isset( $attributes['align'] ) ) {
$class .= ' align' . $attributes['align'];
}

if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) {
$class .= ' is-grid';
Expand Down
3 changes: 1 addition & 2 deletions packages/block-library/src/navigation/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ function render_block_core_navigation( $attributes, $content, $block ) {
array( 'wp-block-navigation' ),
isset( $attributes['className'] ) ? array( $attributes['className'] ) : array(),
( isset( $attributes['orientation'] ) && 'vertical' === $attributes['orientation'] ) ? array( 'is-vertical' ) : array(),
isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array(),
isset( $attributes['align'] ) ? array( 'align' . $attributes['align'] ) : array()
isset( $attributes['itemsJustification'] ) ? array( 'items-justified-' . $attributes['itemsJustification'] ) : array()
);
$class_attribute = sprintf( ' class="%s"', esc_attr( implode( ' ', $classes ) ) );
$style_attribute = ( $colors['inline_styles'] || $font_sizes['inline_styles'] )
Expand Down
4 changes: 0 additions & 4 deletions packages/block-library/src/rss/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@ function render_block_core_rss( $attributes ) {
}

$class = 'wp-block-rss';
if ( isset( $attributes['align'] ) ) {
$class .= ' align' . $attributes['align'];
}

if ( isset( $attributes['blockLayout'] ) && 'grid' === $attributes['blockLayout'] ) {
$class .= ' is-grid';
}
Expand Down
3 changes: 0 additions & 3 deletions packages/block-library/src/search/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ function render_block_core_search( $attributes ) {
if ( isset( $attributes['className'] ) ) {
$class .= ' ' . $attributes['className'];
}
if ( isset( $attributes['align'] ) ) {
$class .= ' align' . $attributes['align'];
}

return sprintf(
'<form class="%s" role="search" method="get" action="%s">%s</form>',
Expand Down
4 changes: 1 addition & 3 deletions packages/block-library/src/tag-cloud/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
* @return string Returns the tag cloud for selected taxonomy.
*/
function render_block_core_tag_cloud( $attributes ) {
$class = isset( $attributes['align'] ) ?
"wp-block-tag-cloud align{$attributes['align']}" :
'wp-block-tag-cloud';
$class = 'wp-block-tag-cloud';

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