diff --git a/assets/blocks/course-categories-block/block.json b/assets/blocks/course-categories-block/block.json index 3b34dce775..c3da3ca438 100644 --- a/assets/blocks/course-categories-block/block.json +++ b/assets/blocks/course-categories-block/block.json @@ -35,7 +35,7 @@ "blockGap": true }, "textAlign": true, - "align": true, + "align": true, "alignWide": true, "typography": { "lineHeight": true, diff --git a/assets/blocks/course-categories-block/course-categories-edit.js b/assets/blocks/course-categories-block/course-categories-edit.js index 2f9575d640..5405b8fe91 100644 --- a/assets/blocks/course-categories-block/course-categories-edit.js +++ b/assets/blocks/course-categories-block/course-categories-edit.js @@ -32,6 +32,7 @@ export function CourseCategoryEdit( props ) { defaultBackgroundColor, defaultTextColor, textColor, + setAttributes, } = props; const { textAlign } = attributes; const { postId, postType } = context; @@ -60,6 +61,7 @@ export function CourseCategoryEdit( props ) { ); if ( 'course' !== postType ) { + setAttributes( { align: false } ); return ( { clientId="some-client-id" attributes={ attributes } context={ context } + setAttributes={ () => {} } /> ); categories.forEach( ( category ) => @@ -77,6 +78,7 @@ describe( 'CourseCategoryEdit', () => { postId: 'some-post-id', postType: 'page', } } + setAttributes={ () => {} } /> );