';
return apply_filters('lorem_ipsum_books_media_store_shortcode_output', $output, 'trx_slider_item', $atts, $content);
}
add_shortcode('trx_slider_item', 'lorem_ipsum_books_media_store_sc_slider_item');
}
/* Register shortcode in the internal SC Builder
-------------------------------------------------------------------- */
if ( !function_exists( 'lorem_ipsum_books_media_store_sc_slider_reg_shortcodes' ) ) {
//add_action('lorem_ipsum_books_media_store_action_shortcodes_list', 'lorem_ipsum_books_media_store_sc_slider_reg_shortcodes');
function lorem_ipsum_books_media_store_sc_slider_reg_shortcodes() {
lorem_ipsum_books_media_store_sc_map("trx_slider", array(
"title" => esc_html__("Slider", 'trx_utils'),
"desc" => wp_kses_data( __("Insert slider into your post (page)", 'trx_utils') ),
"decorate" => true,
"container" => false,
"params" => array_merge(array(
"engine" => array(
"title" => esc_html__("Slider engine", 'trx_utils'),
"desc" => wp_kses_data( __("Select engine for slider. Attention! Swiper is built-in engine, all other engines appears only if corresponding plugings are installed", 'trx_utils') ),
"value" => "swiper",
"type" => "checklist",
"options" => lorem_ipsum_books_media_store_get_sc_param('sliders')
),
"align" => array(
"title" => esc_html__("Float slider", 'trx_utils'),
"desc" => wp_kses_data( __("Float slider to left or right side", 'trx_utils') ),
"divider" => true,
"value" => "",
"type" => "checklist",
"dir" => "horizontal",
"options" => lorem_ipsum_books_media_store_get_sc_param('align')
),
"custom" => array(
"title" => esc_html__("Custom slides", 'trx_utils'),
"desc" => wp_kses_data( __("Make custom slides from inner shortcodes (prepare it on tabs) or prepare slides from posts thumbnails", 'trx_utils') ),
"divider" => true,
"value" => "no",
"type" => "switch",
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
)
),
function_exists('lorem_ipsum_books_media_store_exists_revslider') && lorem_ipsum_books_media_store_exists_revslider() ? array(
"alias" => array(
"title" => esc_html__("Revolution slider alias", 'trx_utils'),
"desc" => wp_kses_data( __("Select Revolution slider to display", 'trx_utils') ),
"dependency" => array(
'engine' => array('revo')
),
"divider" => true,
"value" => "",
"type" => "select",
"options" => lorem_ipsum_books_media_store_get_sc_param('revo_sliders')
)) : array(), array(
"cat" => array(
"title" => esc_html__("Swiper: Category list", 'trx_utils'),
"desc" => wp_kses_data( __("Select category to show post's images. If empty - select posts from any category or from IDs list", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"divider" => true,
"value" => "",
"type" => "select",
"style" => "list",
"multiple" => true,
"options" => lorem_ipsum_books_media_store_array_merge(array(0 => esc_html__('- Select category -', 'trx_utils')), lorem_ipsum_books_media_store_get_sc_param('categories'))
),
"count" => array(
"title" => esc_html__("Swiper: Number of posts", 'trx_utils'),
"desc" => wp_kses_data( __("How many posts will be displayed? If used IDs - this parameter ignored.", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => 3,
"min" => 1,
"max" => 100,
"type" => "spinner"
),
"offset" => array(
"title" => esc_html__("Swiper: Offset before select posts", 'trx_utils'),
"desc" => wp_kses_data( __("Skip posts before select next part.", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => 0,
"min" => 0,
"type" => "spinner"
),
"orderby" => array(
"title" => esc_html__("Swiper: Post order by", 'trx_utils'),
"desc" => wp_kses_data( __("Select desired posts sorting method", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "date",
"type" => "select",
"options" => lorem_ipsum_books_media_store_get_sc_param('sorting')
),
"order" => array(
"title" => esc_html__("Swiper: Post order", 'trx_utils'),
"desc" => wp_kses_data( __("Select desired posts order", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "desc",
"type" => "switch",
"size" => "big",
"options" => lorem_ipsum_books_media_store_get_sc_param('ordering')
),
"ids" => array(
"title" => esc_html__("Swiper: Post IDs list", 'trx_utils'),
"desc" => wp_kses_data( __("Comma separated list of posts ID. If set - parameters above are ignored!", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "",
"type" => "text"
),
"controls" => array(
"title" => esc_html__("Swiper: Show slider controls", 'trx_utils'),
"desc" => wp_kses_data( __("Show arrows inside slider", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"divider" => true,
"value" => "no",
"type" => "switch",
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
),
"pagination" => array(
"title" => esc_html__("Swiper: Show slider pagination", 'trx_utils'),
"desc" => wp_kses_data( __("Show bullets for switch slides", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "no",
"type" => "checklist",
"options" => array(
'no' => esc_html__('None', 'trx_utils'),
'yes' => esc_html__('Dots', 'trx_utils'),
'full' => esc_html__('Side Titles', 'trx_utils'),
'over' => esc_html__('Over Titles', 'trx_utils')
)
),
"titles" => array(
"title" => esc_html__("Swiper: Show titles section", 'trx_utils'),
"desc" => wp_kses_data( __("Show section with post's title and short post's description", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"divider" => true,
"value" => "no",
"type" => "checklist",
"options" => array(
"no" => esc_html__('Not show', 'trx_utils'),
"slide" => esc_html__('Show/Hide info', 'trx_utils'),
"fixed" => esc_html__('Fixed info', 'trx_utils')
)
),
"descriptions" => array(
"title" => esc_html__("Swiper: Post descriptions", 'trx_utils'),
"dependency" => array(
'engine' => array('swiper')
),
"desc" => wp_kses_data( __("Show post's excerpt max length (characters)", 'trx_utils') ),
"value" => 0,
"min" => 0,
"max" => 1000,
"step" => 10,
"type" => "spinner"
),
"links" => array(
"title" => esc_html__("Swiper: Post's title as link", 'trx_utils'),
"desc" => wp_kses_data( __("Make links from post's titles", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "no",
"type" => "hidden", //switch
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
),
"crop" => array(
"title" => esc_html__("Swiper: Crop images", 'trx_utils'),
"desc" => wp_kses_data( __("Crop images in each slide or live it unchanged", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "yes",
"type" => "switch",
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
),
"autoheight" => array(
"title" => esc_html__("Swiper: Autoheight", 'trx_utils'),
"desc" => wp_kses_data( __("Change whole slider's height (make it equal current slide's height)", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => "yes",
"type" => "switch",
"options" => lorem_ipsum_books_media_store_get_sc_param('yes_no')
),
"slides_per_view" => array(
"title" => esc_html__("Swiper: Slides per view", 'trx_utils'),
"desc" => wp_kses_data( __("Slides per view showed in this slider", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => 1,
"min" => 1,
"max" => 6,
"step" => 1,
"type" => "spinner"
),
"slides_space" => array(
"title" => esc_html__("Swiper: Space between slides", 'trx_utils'),
"desc" => wp_kses_data( __("Size of space (in px) between slides", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => 0,
"min" => 0,
"max" => 100,
"step" => 10,
"type" => "spinner"
),
"interval" => array(
"title" => esc_html__("Swiper: Slides change interval", 'trx_utils'),
"desc" => wp_kses_data( __("Slides change interval (in milliseconds: 1000ms = 1s)", 'trx_utils') ),
"dependency" => array(
'engine' => array('swiper')
),
"value" => 5000,
"step" => 500,
"min" => 0,
"type" => "spinner"
),
"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_slider_item",
"title" => esc_html__("Slide", 'trx_utils'),
"desc" => wp_kses_data( __("Slider item", 'trx_utils') ),
"container" => false,
"params" => array(
"src" => array(
"title" => esc_html__("URL (source) for image file", 'trx_utils'),
"desc" => wp_kses_data( __("Select or upload image or write URL from other site for the current slide", 'trx_utils') ),
"readonly" => false,
"value" => "",
"type" => "media"
),
"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_slider_reg_shortcodes_vc' ) ) {
//add_action('lorem_ipsum_books_media_store_action_shortcodes_list_vc', 'lorem_ipsum_books_media_store_sc_slider_reg_shortcodes_vc');
function lorem_ipsum_books_media_store_sc_slider_reg_shortcodes_vc() {
vc_map( array(
"base" => "trx_slider",
"name" => esc_html__("Slider", 'trx_utils'),
"description" => wp_kses_data( __("Insert slider", 'trx_utils') ),
"category" => esc_html__('Content', 'trx_utils'),
'icon' => 'icon_trx_slider',
"class" => "trx_sc_collection trx_sc_slider",
"content_element" => true,
"is_container" => true,
"show_settings_on_create" => true,
"as_parent" => array('only' => 'trx_slider_item'),
"params" => array_merge(array(
array(
"param_name" => "engine",
"heading" => esc_html__("Engine", 'trx_utils'),
"description" => wp_kses_data( __("Select engine for slider. Attention! Swiper is built-in engine, all other engines appears only if corresponding plugings are installed", 'trx_utils') ),
"admin_label" => true,
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('sliders')),
"type" => "dropdown"
),
array(
"param_name" => "align",
"heading" => esc_html__("Float slider", 'trx_utils'),
"description" => wp_kses_data( __("Float slider to left or right side", 'trx_utils') ),
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('align')),
"type" => "dropdown"
),
array(
"param_name" => "custom",
"heading" => esc_html__("Custom slides", 'trx_utils'),
"description" => wp_kses_data( __("Make custom slides from inner shortcodes (prepare it on tabs) or prepare slides from posts thumbnails", 'trx_utils') ),
"class" => "",
"value" => array(esc_html__('Custom slides', 'trx_utils') => 'yes'),
"type" => "checkbox"
)
),
function_exists('lorem_ipsum_books_media_store_exists_revslider') && lorem_ipsum_books_media_store_exists_revslider() ? array(
array(
"param_name" => "alias",
"heading" => esc_html__("Revolution slider alias", 'trx_utils'),
"description" => wp_kses_data( __("Select Revolution slider to display", 'trx_utils') ),
"admin_label" => true,
"class" => "",
'dependency' => array(
'element' => 'engine',
'value' => array('revo')
),
"value" => array_flip(lorem_ipsum_books_media_store_array_merge(array('none' => esc_html__('- Select slider -', 'trx_utils')), lorem_ipsum_books_media_store_get_sc_param('revo_sliders'))),
"type" => "dropdown"
)) : array(), array(
array(
"param_name" => "cat",
"heading" => esc_html__("Categories list", 'trx_utils'),
"description" => wp_kses_data( __("Select category. If empty - show posts from any category or from IDs list", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_array_merge(array(0 => esc_html__('- Select category -', 'trx_utils')), lorem_ipsum_books_media_store_get_sc_param('categories'))),
"type" => "dropdown"
),
array(
"param_name" => "count",
"heading" => esc_html__("Swiper: Number of posts", 'trx_utils'),
"description" => wp_kses_data( __("How many posts will be displayed? If used IDs - this parameter ignored.", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "3",
"type" => "textfield"
),
array(
"param_name" => "offset",
"heading" => esc_html__("Swiper: Offset before select posts", 'trx_utils'),
"description" => wp_kses_data( __("Skip posts before select next part.", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "0",
"type" => "textfield"
),
array(
"param_name" => "orderby",
"heading" => esc_html__("Swiper: Post sorting", 'trx_utils'),
"description" => wp_kses_data( __("Select desired posts sorting method", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('sorting')),
"type" => "dropdown"
),
array(
"param_name" => "order",
"heading" => esc_html__("Swiper: Post order", 'trx_utils'),
"description" => wp_kses_data( __("Select desired posts order", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array_flip(lorem_ipsum_books_media_store_get_sc_param('ordering')),
"type" => "dropdown"
),
array(
"param_name" => "ids",
"heading" => esc_html__("Swiper: Post IDs list", 'trx_utils'),
"description" => wp_kses_data( __("Comma separated list of posts ID. If set - parameters above are ignored!", 'trx_utils') ),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "",
"type" => "textfield"
),
array(
"param_name" => "controls",
"heading" => esc_html__("Swiper: Show slider controls", 'trx_utils'),
"description" => wp_kses_data( __("Show arrows inside slider", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array(esc_html__('Show controls', 'trx_utils') => 'yes'),
"type" => "checkbox"
),
array(
"param_name" => "pagination",
"heading" => esc_html__("Swiper: Show slider pagination", 'trx_utils'),
"description" => wp_kses_data( __("Show bullets or titles to switch slides", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"std" => "no",
"value" => array(
esc_html__('None', 'trx_utils') => 'no',
esc_html__('Dots', 'trx_utils') => 'yes',
esc_html__('Side Titles', 'trx_utils') => 'full',
esc_html__('Over Titles', 'trx_utils') => 'over'
),
"type" => "dropdown"
),
array(
"param_name" => "titles",
"heading" => esc_html__("Swiper: Show titles section", 'trx_utils'),
"description" => wp_kses_data( __("Show section with post's title and short post's description", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array(
esc_html__('Not show', 'trx_utils') => "no",
esc_html__('Show/Hide info', 'trx_utils') => "slide",
esc_html__('Fixed info', 'trx_utils') => "fixed"
),
"type" => "dropdown"
),
array(
"param_name" => "descriptions",
"heading" => esc_html__("Swiper: Post descriptions", 'trx_utils'),
"description" => wp_kses_data( __("Show post's excerpt max length (characters)", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "0",
"type" => "textfield"
),
array(
"param_name" => "links",
"heading" => esc_html__("Swiper: Post's title as link", 'trx_utils'),
"description" => wp_kses_data( __("Make links from post's titles", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array(esc_html__('Titles as a links', 'trx_utils') => 'no'),
"type" => "hidden" //checkbox
),
array(
"param_name" => "crop",
"heading" => esc_html__("Swiper: Crop images", 'trx_utils'),
"description" => wp_kses_data( __("Crop images in each slide or live it unchanged", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array(esc_html__('Crop images', 'trx_utils') => 'yes'),
"type" => "checkbox"
),
array(
"param_name" => "autoheight",
"heading" => esc_html__("Swiper: Autoheight", 'trx_utils'),
"description" => wp_kses_data( __("Change whole slider's height (make it equal current slide's height)", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => array(esc_html__('Autoheight', 'trx_utils') => 'yes'),
"type" => "checkbox"
),
array(
"param_name" => "slides_per_view",
"heading" => esc_html__("Swiper: Slides per view", 'trx_utils'),
"description" => wp_kses_data( __("Slides per view showed in this slider", 'trx_utils') ),
"admin_label" => true,
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "1",
"type" => "textfield"
),
array(
"param_name" => "slides_space",
"heading" => esc_html__("Swiper: Space between slides", 'trx_utils'),
"description" => wp_kses_data( __("Size of space (in px) between slides", 'trx_utils') ),
"admin_label" => true,
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "0",
"type" => "textfield"
),
array(
"param_name" => "interval",
"heading" => esc_html__("Swiper: Slides change interval", 'trx_utils'),
"description" => wp_kses_data( __("Slides change interval (in milliseconds: 1000ms = 1s)", 'trx_utils') ),
"group" => esc_html__('Details', 'trx_utils'),
'dependency' => array(
'element' => 'engine',
'value' => array('swiper')
),
"class" => "",
"value" => "5000",
"type" => "textfield"
),
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')
))
) );
vc_map( array(
"base" => "trx_slider_item",
"name" => esc_html__("Slide", 'trx_utils'),
"description" => wp_kses_data( __("Slider item - single slide", 'trx_utils') ),
"show_settings_on_create" => true,
"content_element" => true,
"is_container" => false,
'icon' => 'icon_trx_slider_item',
"class" => "trx_sc_single trx_sc_slider_item",
"as_child" => array('only' => 'trx_slider'),
"as_parent" => array('except' => 'trx_slider'),
"params" => array(
array(
"param_name" => "src",
"heading" => esc_html__("URL (source) for image file", 'trx_utils'),
"description" => wp_kses_data( __("Select or upload image or write URL from other site for the current slide", 'trx_utils') ),
"admin_label" => true,
"class" => "",
"value" => "",
"type" => "attach_image"
),
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('css')
)
) );
class WPBakeryShortCode_Trx_Slider extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeCollection {}
class WPBakeryShortCode_Trx_Slider_Item extends Lorem_Ipsum_Books_Media_Store_VC_ShortCodeSingle {}
}
}
?>