Plugin 1.2 (FAQ ohne Ueberschrift, Plus/Minus) und Beitragslayout-CSS
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* Plugin Name: Skrift Ratgeber Felder
|
||||
* Description: Meta-Felder fuer Ratgeberartikel (kurzantwort, faq, cta_ziel, stand_datum) mit Eingabebox im Editor, Shortcodes und Elementor-Widgets, die das FAQ-Feld automatisch als Umschalter ausgeben.
|
||||
* Version: 1.1.0
|
||||
* Version: 1.2.0
|
||||
* Author: Lucas Orth
|
||||
*
|
||||
* Ablage: wp-content/mu-plugins/skrift-ratgeber-felder.php
|
||||
@@ -230,8 +230,8 @@ function skrift_faq_basis_css() {
|
||||
. '.skrift-faq__eintrag{border-bottom:1px solid rgba(0,0,0,.12)}'
|
||||
. '.skrift-faq__frage{cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:center;gap:16px;padding:16px 0;font-weight:600}'
|
||||
. '.skrift-faq__frage::-webkit-details-marker{display:none}'
|
||||
. '.skrift-faq__frage::after{content:"";flex:0 0 auto;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);transition:transform .2s}'
|
||||
. '.skrift-faq__eintrag[open] .skrift-faq__frage::after{transform:rotate(-135deg)}'
|
||||
. '.skrift-faq__frage::after{content:"+";flex:0 0 auto;width:1em;text-align:center;font-weight:400;font-size:1.4em;line-height:1}'
|
||||
. '.skrift-faq__eintrag[open] .skrift-faq__frage::after{content:"\\2212"}'
|
||||
. '.skrift-faq__antwort{padding:0 0 16px}'
|
||||
. '.skrift-faq__antwort>*:last-child{margin-bottom:0}'
|
||||
. '</style>';
|
||||
@@ -373,17 +373,6 @@ add_action( 'elementor/widgets/register', function ( $widgets_manager ) {
|
||||
'type' => $C::RAW_HTML,
|
||||
'raw' => 'Fragen und Antworten kommen aus dem Meta-Feld <code>faq</code> des jeweiligen Beitrags.',
|
||||
) );
|
||||
$this->add_control( 'titel', array(
|
||||
'label' => 'Ueberschrift',
|
||||
'type' => $C::TEXT,
|
||||
'default' => 'Häufige Fragen',
|
||||
) );
|
||||
$this->add_control( 'titel_tag', array(
|
||||
'label' => 'HTML-Tag der Ueberschrift',
|
||||
'type' => $C::SELECT,
|
||||
'default' => 'h2',
|
||||
'options' => array( 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'div' => 'div' ),
|
||||
) );
|
||||
$this->add_control( 'erste_offen', array(
|
||||
'label' => 'Erste Frage geoeffnet',
|
||||
'type' => $C::SWITCHER,
|
||||
@@ -396,24 +385,6 @@ add_action( 'elementor/widgets/register', function ( $widgets_manager ) {
|
||||
) );
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section( 'stil_titel', array( 'label' => 'Ueberschrift', 'tab' => $C::TAB_STYLE ) );
|
||||
$this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array(
|
||||
'name' => 'titel_typo',
|
||||
'selector' => '{{WRAPPER}} .skrift-faq__titel',
|
||||
) );
|
||||
$this->add_control( 'titel_farbe', array(
|
||||
'label' => 'Farbe',
|
||||
'type' => $C::COLOR,
|
||||
'selectors' => array( '{{WRAPPER}} .skrift-faq__titel' => 'color: {{VALUE}};' ),
|
||||
) );
|
||||
$this->add_responsive_control( 'titel_abstand', array(
|
||||
'label' => 'Abstand darunter',
|
||||
'type' => $C::SLIDER,
|
||||
'size_units' => array( 'px', 'em' ),
|
||||
'selectors' => array( '{{WRAPPER}} .skrift-faq__titel' => 'margin-bottom: {{SIZE}}{{UNIT}};' ),
|
||||
) );
|
||||
$this->end_controls_section();
|
||||
|
||||
$this->start_controls_section( 'stil_frage', array( 'label' => 'Frage', 'tab' => $C::TAB_STYLE ) );
|
||||
$this->add_group_control( \Elementor\Group_Control_Typography::get_type(), array(
|
||||
'name' => 'frage_typo',
|
||||
@@ -501,8 +472,6 @@ add_action( 'elementor/widgets/register', function ( $widgets_manager ) {
|
||||
}
|
||||
|
||||
echo skrift_faq_html( $faq, array( // phpcs:ignore WordPress.Security.EscapeOutput
|
||||
'titel' => (string) ( $s['titel'] ?? '' ),
|
||||
'titel_tag' => (string) ( $s['titel_tag'] ?? 'h2' ),
|
||||
'erste_offen' => 'yes' === ( $s['erste_offen'] ?? '' ),
|
||||
'schema' => 'yes' === ( $s['schema'] ?? '' ) && ! $bearbeiten,
|
||||
) );
|
||||
|
||||
Reference in New Issue
Block a user