File: /home/lesanew/www/wp-content/plugins/neobeat-core/inc/shortcodes/accordion/accordion-child.php
<?php
if ( ! function_exists( 'neobeat_core_add_accordion_child_shortcode' ) ) {
/**
* Function that add shortcode into shortcodes list for registration
*
* @param $shortcodes array
*
* @return array
*/
function neobeat_core_add_accordion_child_shortcode( $shortcodes ) {
$shortcodes[] = 'NeoBeatCoreAccordionChildShortcode';
return $shortcodes;
}
add_filter( 'neobeat_core_filter_register_shortcodes', 'neobeat_core_add_accordion_child_shortcode' );
}
if ( class_exists( 'NeoBeatCoreShortcode' ) ) {
class NeoBeatCoreAccordionChildShortcode extends NeoBeatCoreShortcode {
public function map_shortcode() {
$this->set_shortcode_path( NEOBEAT_CORE_SHORTCODES_URL_PATH . '/accordion' );
$this->set_base( 'neobeat_core_accordion_child' );
$this->set_name( esc_html__( 'Accordion Child', 'neobeat-core' ) );
$this->set_description( esc_html__( 'Shortcode that adds accordion child to accordion holder', 'neobeat-core' ) );
$this->set_category( esc_html__( 'NeoBeat Core', 'neobeat-core' ) );
$this->set_is_child_shortcode( true );
$this->set_parent_elements( array(
'neobeat_core_accordion'
) );
$this->set_is_parent_shortcode( true );
$this->set_option( array(
'field_type' => 'text',
'name' => 'title',
'title' => esc_html__( 'Title', 'neobeat-core' ),
) );
$this->set_option( array(
'field_type' => 'select',
'name' => 'title_tag',
'title' => esc_html__( 'Title Tag', 'neobeat-core' ),
'options' => neobeat_core_get_select_type_options_pool( 'title_tag' ),
'default_value' => 'h3'
) );
$this->set_option( array(
'field_type' => 'text',
'name' => 'layout',
'title' => esc_html__( 'Layout', 'neobeat-core' ),
'default_value' => '',
'visibility' => array('map_for_page_builder' => false)
) );
}
public function render( $options, $content = null ) {
parent::render( $options );
$atts = $this->get_atts();
$atts['content'] = $content;
return neobeat_core_get_template_part( 'shortcodes/accordion', 'variations/'.$atts['layout'].'/templates/child', '', $atts );
}
}
}