| 1 |
<?php |
| 2 |
namespace WPDeveloper\BetterDocs\Shortcodes; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; |
| 6 |
} |
| 7 |
|
| 8 |
|
| 9 |
use WPDeveloper\BetterDocs\Shortcodes\FaqLayoutThree; |
| 10 |
|
| 11 |
class FaqTab extends FaqLayoutThree { |
| 12 |
protected $layout = 'layout-4'; |
| 13 |
|
| 14 |
public function get_name() { |
| 15 |
return 'betterdocs_faq_tab'; |
| 16 |
} |
| 17 |
|
| 18 |
public function render( $atts, $content = null ) { |
| 19 |
|
| 20 |
$this->icon_position = isset( $this->atts['button_icon_position'] ) ? $this->atts['button_icon_position'] : ''; |
| 21 |
|
| 22 |
if ( $this->attributes['is_gutenberg'] && $this->attributes['button_icon_position'] == 'before' && $this->attributes['show_button_icon'] ) { |
| 23 |
add_action( 'betterdocs_faq_post_before', [ $this, 'icons' ] ); |
| 24 |
} elseif ( $this->attributes['is_gutenberg'] && $this->attributes['button_icon_position'] == 'after' && $this->attributes['show_button_icon'] ) { |
| 25 |
add_action( 'betterdocs_faq_post_after', [ $this, 'icons' ] ); |
| 26 |
} else { |
| 27 |
add_action( $this->icon_hook, [ $this, 'icons' ] ); |
| 28 |
} |
| 29 |
|
| 30 |
$this->views( 'shortcodes/faq-tab' ); |
| 31 |
|
| 32 |
remove_action( $this->icon_hook, [ $this, 'icons' ] ); |
| 33 |
} |
| 34 |
} |
| 35 |
|