Fix Customer Account block doing a 404 request in the frontend (https://github.com/woocommerce/woocommerce-blocks/pull/8798)

This commit is contained in:
Albert Juhé Lluveras 2023-03-21 11:31:20 +01:00 committed by GitHub
parent ef97fad080
commit 6a629c60b2
2 changed files with 13 additions and 2 deletions

View File

@ -286,7 +286,7 @@ abstract class AbstractBlock {
*
* @see $this->register_block_type()
* @param string $key Data to get, or default to everything.
* @return array|string
* @return array|string|null
*/
protected function get_block_type_script( $key = null ) {
$script = [

View File

@ -95,7 +95,7 @@ class CustomerAccount extends AbstractBlock {
*
* @param array $attributes Block attributes.
*
* @return string Label to render on the block
* @return string Label to render on the block.
*/
private function render_label( $attributes ) {
if ( self::ICON_ONLY === $attributes['displayStyle'] ) {
@ -106,4 +106,15 @@ class CustomerAccount extends AbstractBlock {
? __( 'My Account', 'woo-gutenberg-products-block' )
: __( 'Login', 'woo-gutenberg-products-block' );
}
/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*
* @return null This block has no frontend script.
*/
protected function get_block_type_script( $key = null ) {
return null;
}
}