Skip to content

Commit a48421e

Browse files
committed
fix: access substitutionRules directly for blocks that uses TEMPLATE
1 parent ddf8c37 commit a48421e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/block/icon-box/edit.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import {
3333
withBlockAttributeContext, withBlockWrapperIsHovered, withQueryLoopContext,
3434
} from '~stackable/higher-order'
3535
import { substituteCoreIfDisabled } from '~stackable/util'
36+
import { substitutionRules } from '../../blocks'
3637

3738
/**
3839
* WordPress dependencies
@@ -50,9 +51,12 @@ export const TEMPLATE = [
5051
text: __( 'Icon Box', i18n ), hasP: true, textTag: 'h4',
5152
} ],
5253
] ],
53-
substituteCoreIfDisabled( 'stackable/text', {
54-
text: 'Description for this block. Use this space for describing your block.',
55-
} ),
54+
substituteCoreIfDisabled(
55+
'stackable/text',
56+
{ text: 'Description for this block.' },
57+
[],
58+
substitutionRules,
59+
),
5660
]
5761

5862
const Edit = props => {

src/block/timeline/edit.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
} from '~stackable/higher-order'
4444
import { range } from 'lodash'
4545
import { substituteCoreIfDisabled } from '~stackable/util'
46+
import { substitutionRules } from '../../blocks'
4647

4748
/**
4849
* WordPress dependencies
@@ -69,9 +70,12 @@ const TEMPLATE = [
6970
left: 0,
7071
},
7172
}, [
72-
substituteCoreIfDisabled( 'stackable/text', {
73-
text: _x( 'Description for this block. Use this space for describing your block. Any text will do.', 'Content placeholder', i18n ),
74-
} ),
73+
substituteCoreIfDisabled(
74+
'stackable/text',
75+
{ text: _x( 'Description for this block. Use this space for describing your block. Any text will do.', 'Content placeholder', i18n ) },
76+
[],
77+
substitutionRules,
78+
),
7579
] ],
7680
]
7781

0 commit comments

Comments
 (0)