diff --git a/plugins/carhop-blocks/src/cta/edit.js b/plugins/carhop-blocks/src/cta/edit.js
index 86313f7..378327a 100644
--- a/plugins/carhop-blocks/src/cta/edit.js
+++ b/plugins/carhop-blocks/src/cta/edit.js
@@ -14,13 +14,12 @@ import { Tip } from "@wordpress/components";
import { ReactComponent as ArrowIcon } from "./img/carhop-fleche-lien-externe-full.svg";
export default function Edit({ attributes, setAttributes }) {
- const { color } = attributes;
+ const { color, link } = attributes;
const colors = useSetting("color.palette.theme");
function handleColorChange(value) {
setAttributes({ color: value });
}
- console.log(color);
return (
<>
diff --git a/plugins/carhop-blocks/src/cta/render.php b/plugins/carhop-blocks/src/cta/render.php
index 95cb1aa..31af90e 100644
--- a/plugins/carhop-blocks/src/cta/render.php
+++ b/plugins/carhop-blocks/src/cta/render.php
@@ -3,9 +3,7 @@ $align = isset($attributes['align']) ? $attributes['align'] : '';
$link = isset($attributes['link']) ? $attributes['link'] : [];
$text = isset($attributes['text']) ? $attributes['text'] : '';
$color = isset($attributes['color']) ? $attributes['color'] : '';
-
-
-
+$target = isset($link) && $link['opensInNewTab'] ? '_blank' : '_self';
$styles = [];
if ($color) {
@@ -21,6 +19,6 @@ $wrapper_attributes = get_block_wrapper_attributes([
$link_url = isset($link['url']) ? esc_url($link['url']) : '#';
?>
->
+ target="">
\ No newline at end of file