PATH:
home
/
lab2454c
/
fcxpro.com
/
wp-content
/
plugins
/
webon-core
/
inc
/
shortcodes
/
accordion
<?php if ( ! function_exists( 'webon_core_add_accordion_child_shortcode' ) ) { /** * Function that add shortcode into shortcodes list for registration * * @param array $shortcodes * * @return array */ function webon_core_add_accordion_child_shortcode( $shortcodes ) { $shortcodes[] = 'WebOnCoreAccordionChildShortcode'; return $shortcodes; } add_filter( 'webon_core_filter_register_shortcodes', 'webon_core_add_accordion_child_shortcode' ); } if ( class_exists( 'WebOnCoreShortcode' ) ) { class WebOnCoreAccordionChildShortcode extends WebOnCoreShortcode { public function map_shortcode() { $this->set_shortcode_path( WEBON_CORE_SHORTCODES_URL_PATH . '/accordion' ); $this->set_base( 'webon_core_accordion_child' ); $this->set_name( esc_html__( 'Accordion Child', 'webon-core' ) ); $this->set_description( esc_html__( 'Shortcode that adds accordion child to accordion holder', 'webon-core' ) ); $this->set_category( esc_html__( 'WebOn Core', 'webon-core' ) ); $this->set_is_child_shortcode( true ); $this->set_parent_elements( array( 'webon_core_accordion' ) ); $this->set_is_parent_shortcode( true ); $this->set_option( array( 'field_type' => 'text', 'name' => 'title', 'title' => esc_html__( 'Title', 'webon-core' ), ) ); $this->set_option( array( 'field_type' => 'select', 'name' => 'title_tag', 'title' => esc_html__( 'Title Tag', 'webon-core' ), 'options' => webon_core_get_select_type_options_pool( 'title_tag' ), 'default_value' => 'h3' ) ); $this->set_option( array( 'field_type' => 'text', 'name' => 'layout', 'title' => esc_html__( 'Layout', 'webon-core' ), 'default_value' => '', 'visibility' => array('map_for_page_builder' => false) ) ); $this->set_option( array( 'field_type' => 'color', 'name' => 'border_color', 'title' => esc_html__( 'Border Color', 'webon-core' ), 'description' => esc_html__( 'This option will work only for Toggle modern type', 'webon-core' ) ) ); } public function render( $options, $content = null ) { parent::render( $options ); $atts = $this->get_atts(); $atts['content'] = $content; $atts['border_style'] = $this->get_border_style( $atts ); return webon_core_get_template_part( 'shortcodes/accordion', 'variations/'.$atts['layout'].'/templates/child', '', $atts ); } private function get_border_style( $atts ) { $styles = array(); if ( ! empty( $atts['border_color'] ) ) { $styles[] = 'border-color: ' . $atts['border_color']; } return $styles; } } }
[+]
..
[+]
variations
[-] accordion.php
[edit]
[-] accordion-child.php
[edit]
[-] include.php
[edit]
[+]
assets
[-] accordion-elementor.php
[edit]