'
. (lorem_ipsum_books_media_store_param_is_on(lorem_ipsum_books_media_store_storage_get_array('sc_tab_data', 'scroll'))
? '
'
: '')
. '
';
return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_tab', $atts, $content);
}
add_shortcode("trx_tab", "lorem_ipsum_books_media_store_sc_tab");
}
/* Register shortcode in the internal SC Builder
-------------------------------------------------------------------- */
if ( !function_exists( 'lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes' ) ) {
//add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes');
function lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes() {
lorem_ipsum_books_media_store_sc_map("trx_tabs", array(
"title" => esc_html__("Tabs", 'trx_utils'),
"desc" => wp_kses_data( __("Insert tabs in your page (post)", 'trx_utils') ),
"decorate" => true,
"container" => false,
"params" => array(
"style" => array(
"title" => esc_html__("Tabs style", 'trx_utils'),
"desc" => wp_kses_data( __("Select style for tabs items", 'trx_utils') ),
"value" => 1,
"options" => lorem_ipsum_books_media_store_get_list_styles(1, 2),
"type" => "radio"
),
"initial" => array(
"title" => esc_html__("Initially opened tab", 'trx_utils'),
"desc" => wp_kses_data( __("Number of initially opened tab", 'trx_utils') ),
"divider" => true,
"value" => 1,
"min" => 0,
"type" => "spinner"
),
"scroll" => array(
"title" => esc_html__("Use scroller", 'trx_utils'),
"desc" => wp_kses_data( __("Use scroller to show tab content (height parameter required)", 'trx_utils') ),
"divider" => true,
"value" => "no",
"type" => "switch",
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
),
"width" => lorem_ipsum_books_media_store_shortcodes_width(),
"height" => lorem_ipsum_books_media_store_shortcodes_height(),
"top" => lorem_ipsum_books_media_store_get_sc_param('top'),
"bottom" => lorem_ipsum_books_media_store_get_sc_param('bottom'),
"left" => lorem_ipsum_books_media_store_get_sc_param('left'),
"right" => lorem_ipsum_books_media_store_get_sc_param('right'),
"id" => lorem_ipsum_books_media_store_get_sc_param('id'),
"class" => lorem_ipsum_books_media_store_get_sc_param('class'),
"animation" => lorem_ipsum_books_media_store_get_sc_param('animation'),
"css" => lorem_ipsum_books_media_store_get_sc_param('css')
),
"children" => array(
"name" => "trx_tab",
"title" => esc_html__("Tab", 'trx_utils'),
"desc" => wp_kses_data( __("Tab item", 'trx_utils') ),
"container" => true,
"params" => array(
"title" => array(
"title" => esc_html__("Tab title", 'trx_utils'),
"desc" => wp_kses_data( __("Current tab title", 'trx_utils') ),
"value" => "",
"type" => "text"
),
"_content_" => array(
"title" => esc_html__("Tab content", 'trx_utils'),
"desc" => wp_kses_data( __("Current tab content", 'trx_utils') ),
"divider" => true,
"rows" => 4,
"value" => "",
"type" => "textarea"
),
"id" => lorem_ipsum_books_media_store_get_sc_param('id'),
"class" => lorem_ipsum_books_media_store_get_sc_param('class'),
"css" => lorem_ipsum_books_media_store_get_sc_param('css')
)
)
));
}
}
/* Register shortcode in the VC Builder
-------------------------------------------------------------------- */
if ( !function_exists( 'lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes_vc' ) ) {
//add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes_vc');
function lorem_ipsum_books_media_store_sc_tabs_reg_shortcodes_vc() {
$tab_id_1 = 'sc_tab_'.time() . '_1_' . rand( 0, 100 );
$tab_id_2 = 'sc_tab_'.time() . '_2_' . rand( 0, 100 );
vc_map( array(
"base" => "trx_tabs",
"name" => esc_html__("Tabs", 'trx_utils'),
"desc" => wp_kses_data( __("Tabs", 'trx_utils') ),
"category" => esc_html__('Content', 'trx_utils'),
'icon' => 'icon_trx_tabs',
"class" => "trx_sc_collection trx_sc_tabs",
"content_element" => true,
"is_container" => true,
"show_settings_on_create" => false,
"as_parent" => array('only' => 'trx_tab'),
"params" => array(
array(
"param_name" => "style",
"heading" => esc_html__("Tabs style", 'trx_utils'),
"desc" => wp_kses_data( __("Select style of tabs items", 'trx_utils') ),
"admin_label" => true,
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_get_list_styles(1, 2)),
"type" => "dropdown"
),
array(
"param_name" => "initial",
"heading" => esc_html__("Initially opened tab", 'trx_utils'),
"desc" => wp_kses_data( __("Number of initially opened tab", 'trx_utils') ),
"class" => "",
"value" => 1,
"type" => "textfield"
),
array(
"param_name" => "scroll",
"heading" => esc_html__("Scroller", 'trx_utils'),
"desc" => wp_kses_data( __("Use scroller to show tab content (height parameter required)", 'trx_utils') ),
"class" => "",
"value" => array("Use scroller" => "yes" ),
"type" => "checkbox"
),
lorem_ipsum_books_media_store_get_vc_param('id'),
lorem_ipsum_books_media_store_get_vc_param('class'),
lorem_ipsum_books_media_store_get_vc_param('animation'),
lorem_ipsum_books_media_store_get_vc_param('css'),
lorem_ipsum_books_media_store_vc_width(),
lorem_ipsum_books_media_store_vc_height(),
lorem_ipsum_books_media_store_get_vc_param('margin_top'),
lorem_ipsum_books_media_store_get_vc_param('margin_bottom'),
lorem_ipsum_books_media_store_get_vc_param('margin_left'),
lorem_ipsum_books_media_store_get_vc_param('margin_right')
),
'default_content' => '
[trx_tab title="' . esc_html__( 'Tab 1', 'trx_utils') . '" tab_id="'.esc_attr($tab_id_1).'"][/trx_tab]
[trx_tab title="' . esc_html__( 'Tab 2', 'trx_utils') . '" tab_id="'.esc_attr($tab_id_2).'"][/trx_tab]
',
"custom_markup" => '