Register block in PHP and Add default opt in text when saving example block in `@woocommerce/extend-cart-checkout-block` (#48581)
This commit is contained in:
parent
eaf57e9f15
commit
b94fd1127d
|
@ -20,6 +20,7 @@
|
|||
*/
|
||||
add_action( 'woocommerce_blocks_loaded',
|
||||
function () {
|
||||
register_block_type_from_metadata( __DIR__ . '/build/js/checkout-newsletter-subscription-block' );
|
||||
require_once __DIR__ . '/{{slug}}-blocks-integration.php';
|
||||
add_action(
|
||||
'woocommerce_blocks_cart_block_registration',
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: fix
|
||||
|
||||
Ensures the default text shows when saving the example newsletter subscription block.
|
|
@ -43,7 +43,7 @@ export const Save = ( { attributes } ) => {
|
|||
const { text } = attributes;
|
||||
return (
|
||||
<div { ...useBlockProps.save() }>
|
||||
<RichText.Content value={ text } />
|
||||
<RichText.Content value={ text || optInDefaultText } />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue