Skip to content

Commit 8bbe4b3

Browse files
fix (migration): do not re-migrate button gradient color if it's already migrated before
1 parent 81e0597 commit 8bbe4b3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/block-components/button/deprecated.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export const deprecateButtonGradientColor = {
3232
return getAttribute( 'backgroundColorType' ) === 'gradient' && getAttribute( 'backgroundColor2' )
3333
},
3434
migrate: attrNameTemplate => attributes => {
35+
// Do not migrate if the attributes are not eligible.
36+
if ( ! deprecateButtonGradientColor.isEligible( attrNameTemplate )( attributes ) ) {
37+
return attributes
38+
}
39+
3540
const getAttrName = getAttrNameFunction( attrNameTemplate )
3641
const getAttribute = _attrName => attributes[ getAttrName( _attrName ) ]
3742

0 commit comments

Comments
 (0)