File tree Expand file tree Collapse file tree 3 files changed +9
-29
lines changed
Expand file tree Collapse file tree 3 files changed +9
-29
lines changed Original file line number Diff line number Diff line change 55 "author" : " Greenpeace International" ,
66 "license" : " GPL-3.0" ,
77 "scripts" : {
8- "start" : " wp-scripts start --config webpack.config.js --mode=development" ,
9- "build" : " wp-scripts build --config webpack.config.js --mode=production" ,
8+ "start" : " wp-scripts start --blocks-manifest -- config webpack.config.js --mode=development" ,
9+ "build" : " wp-scripts build --blocks-manifest -- config webpack.config.js --mode=production" ,
1010 "analyze" : " wp-scripts build --config webpack.config.js --mode=production --env analyze" ,
1111 "lint:css" : " npx stylelint 'assets/src/scss/**/*.scss'" ,
1212 "lint:js" : " npx eslint 'assets/src/**/*.js' 'tests/e2e/**/*.js' 'admin/js/**/*.js'" ,
1818 "@playwright/test" : " ^1.49.1" ,
1919 "@wordpress/e2e-test-utils-playwright" : " ^1.16.0" ,
2020 "@wordpress/eslint-plugin" : " ^15.1.0" ,
21- "@wordpress/scripts" : " ^26.19 .0" ,
21+ "@wordpress/scripts" : " ^31.2 .0" ,
2222 "ajv" : " ^8.7.1" ,
2323 "autoprefixer" : " ^9.6.1" ,
2424 "babel-loader" : " ^8.2.3" ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 66use P4 \MasterTheme \Features \Planet4Blocks ;
77use P4 \MasterTheme \Patterns \BlockPattern ;
88use P4 \MasterTheme \View \View ;
9- use P4 \MasterTheme \Blocks \BaseBlock ;
109use RuntimeException ;
1110
1211/**
@@ -217,11 +216,12 @@ public static function add_blocks(): void
217216 new Blocks \TakeActionBoxout ();//NOSONAR
218217 new Blocks \Timeline ();//NOSONAR
219218 new Blocks \SecondaryNavigation ();//NOSONAR
220- Blocks \Register::registerFromAssets ('TopicLink ' , [
221- 'render_callback ' => function ($ attributes ) {
222- return BaseBlock::render_frontend_from_blockname ($ attributes , 'planet4-blocks/topic-link ' );
223- },
224- ]);
219+
220+ // Register blocks from block.json files.
221+ wp_register_block_types_from_metadata_collection (
222+ get_template_directory () . '/assets/build/blocks/ ' ,
223+ get_template_directory () . '/assets/build/blocks-manifest.php '
224+ );
225225
226226 $ pattern_categories = [
227227 'page-headers ' => 'Page Headers ' ,
You can’t perform that action at this time.
0 commit comments