diff --git a/blocks/init/src/Blocks/components/button/button.php b/blocks/init/src/Blocks/components/button/button.php index d12f4ba..c6800f4 100644 --- a/blocks/init/src/Blocks/components/button/button.php +++ b/blocks/init/src/Blocks/components/button/button.php @@ -19,6 +19,7 @@ $additionalClass = $attributes['additionalClass'] ?? ''; $additionalAttributes = $attributes['additionalAttributes'] ?? []; $buttonId = Helpers::checkAttr('buttonId', $attributes, $manifest); +$buttonType = Helpers::checkAttr('buttonType', $attributes, $manifest); $buttonUrl = Helpers::checkAttr('buttonUrl', $attributes, $manifest); $buttonIsNewTab = Helpers::checkAttr('buttonIsNewTab', $attributes, $manifest); @@ -60,8 +61,8 @@ $buttonTag = !empty($buttonUrl) ? 'a' : 'button'; -if (empty($buttonUrl)) { - $buttonAttrs['type'] = Helpers::checkAttr('buttonType', $attributes, $manifest); +if (empty($buttonUrl) && !empty($buttonType)) { + $buttonAttrs['type'] = $buttonType; } ?> diff --git a/blocks/init/src/Blocks/components/button/manifest.json b/blocks/init/src/Blocks/components/button/manifest.json index 79f3156..b41797a 100644 --- a/blocks/init/src/Blocks/components/button/manifest.json +++ b/blocks/init/src/Blocks/components/button/manifest.json @@ -22,7 +22,7 @@ }, "buttonType": { "type": "string", - "default": "button" + "default": "" }, "buttonColor": { "type": "string",