From: Stephen Cameron Date: Tue, 15 Sep 2020 14:31:05 +0000 (+0200) Subject: WIP #3890 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=87e1beb02bbfe852a5817a93dda7e302305a0d4d;p=ccv-wordpress.git WIP #3890 @0.5 --- diff --git a/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php b/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php index f74ee70..03760ac 100644 --- a/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php +++ b/wp-content/mu-plugins/cube/src/Elementor/Widgets/TextBlock.php @@ -58,6 +58,20 @@ class TextBlock extends _Base { ] ); + $this->add_control( + 'title_tag', + [ + 'label' => __( 'Balise de titre (SEO)', 'cube' ), + 'type' => Controls_Manager::SELECT, + 'options' => [ + 'h1' => __( 'H1', 'cube' ), + 'h2' => __( 'H2 (Défaut)', 'cube' ), + 'h3' => __( 'H3', 'cube' ), + ], + 'default' => 'h2', + ] + ); + $this->add_control( 'body', [ @@ -237,6 +251,7 @@ class TextBlock extends _Base { protected function render() { $title = $this->get_settings('title'); + $title_tag = $this->get_settings('title_tag'); $title_size = $this->get_settings('title_size'); $body = $this->parse_text_editor($this->get_settings('body')); $cta_text = $this->get_settings('cta_text'); @@ -270,7 +285,7 @@ class TextBlock extends _Base { // Rendered content echo '
'; - if (!empty($title)) echo "

get_render_attribute_string('title')}>$title

"; + if (!empty($title)) echo "<{$title_tag} {$this->get_render_attribute_string('title')}>$title"; if (!empty($body)) echo "
get_render_attribute_string('body')}>$body
"; if (!empty($cta_text)) { echo 'get_render_attribute_string('cta_text') .'>'; @@ -306,7 +321,7 @@ class TextBlock extends _Base {
<# if ('' !== settings.title) { #> -

{{{ settings.title }}}

+ <{{{ settings.title_tag }}} {{{ view.getRenderAttributeString( 'title' ) }}}>{{{ settings.title }}} <# } #> <# if ('' !== settings.body) { #>