@total_onion/onion-library 2.0.15 → 2.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/createNewChildBlock2.js
CHANGED
|
@@ -56,11 +56,6 @@ if (!newBlockName) {
|
|
|
56
56
|
if (!patternID) {
|
|
57
57
|
return console.log('Did you forget to supply the pattern ID?');
|
|
58
58
|
}
|
|
59
|
-
// if (dynamicEntryPoints.indexOf(newBlockName) !== -1) {
|
|
60
|
-
// return console.log(
|
|
61
|
-
// `Alas! There is already a block called ${newBlockName} :( You'll have to try something else..`
|
|
62
|
-
// );
|
|
63
|
-
// }
|
|
64
59
|
|
|
65
60
|
fs.writeFileSync(
|
|
66
61
|
`${themePath}/inc/acf-blocks/${newBlockName}.php`,
|
|
@@ -69,10 +64,6 @@ fs.writeFileSync(
|
|
|
69
64
|
|
|
70
65
|
const blockName = 'group-container-v3';
|
|
71
66
|
|
|
72
|
-
// console.log(`${srcPathJs}/block-${blockName}/${blockName}.js`);
|
|
73
|
-
// console.log('__dirname:', __dirname);
|
|
74
|
-
// console.log('process.cwd():', process.cwd());
|
|
75
|
-
|
|
76
67
|
const fullPath = `${srcPathJs}/block-${blockName}/${blockName}.js`;
|
|
77
68
|
|
|
78
69
|
const jsdir = `Assets/js/blocks/`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
module.exports = function (newBlockName, projectName) {
|
|
2
|
-
|
|
2
|
+
return `<?php
|
|
3
3
|
|
|
4
4
|
acf_register_block_type(
|
|
5
5
|
array(
|
|
@@ -8,12 +8,12 @@ acf_register_block_type(
|
|
|
8
8
|
newBlockName.charAt(0).toUpperCase() +
|
|
9
9
|
newBlockName.slice(1).replaceAll('-', ' ')
|
|
10
10
|
}', '${projectName} Admin' ),
|
|
11
|
-
'render_callback' => '
|
|
11
|
+
'render_callback' => 'athena_block_render_post_object_v3',
|
|
12
12
|
'category' => 'common',
|
|
13
13
|
'icon' => get_svg_icon_content('brick.svg'),
|
|
14
14
|
'keywords' => array('content', 'text' ),
|
|
15
15
|
'mode' => 'preview',
|
|
16
16
|
'supports' => array( 'align' => false, 'anchor' => true ),
|
|
17
17
|
)
|
|
18
|
-
)
|
|
19
|
-
}
|
|
18
|
+
);`;
|
|
19
|
+
};
|