Prevent PHP `doing_it_wrong` warnings in extend-cart-checkout-block package (#52195)

This commit is contained in:
Thomas Roberts 2024-10-23 15:07:40 +01:00 committed by GitHub
parent fa2ce01246
commit cf8b0d5a1a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 2 deletions

View File

@ -18,9 +18,17 @@
*
* @package {{namespace}}
*/
add_action( 'woocommerce_blocks_loaded',
add_action(
'init',
function () {
register_block_type_from_metadata( __DIR__ . '/build/js/checkout-newsletter-subscription-block' );
}
);
add_action(
'woocommerce_blocks_loaded',
function () {
require_once __DIR__ . '/{{slug}}-blocks-integration.php';
add_action(
'woocommerce_blocks_cart_block_registration',

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Prevent doing_it_wrong warnings while registering the example block.

View File

@ -4,7 +4,7 @@ module.exports = {
npmDevDependencies: [
'@woocommerce/dependency-extraction-webpack-plugin',
'@woocommerce/eslint-plugin',
'@wordpress/prettier-config',
'@wordpress/prettier-config@2.25.13',
'@wordpress/scripts',
],
},