Files
toppic/includes/vc-func.php
2024-04-06 11:45:36 +02:00

111 lines
3.1 KiB
PHP

<?php
/*-----------------------------------------------------------------------------------*/
/* List of post types for which Visual Composer should be available by default
/*-----------------------------------------------------------------------------------*/
$list = array(
'page',
'gallery',
'portfolio'
);
//vc_editor_set_post_types( $list );
/* --- Removing shortcodes --- */
vc_remove_element("vc_widget_sidebar");
vc_remove_element("vc_wp_search");
vc_remove_element("vc_wp_meta");
vc_remove_element("vc_wp_recentcomments");
vc_remove_element("vc_wp_calendar");
vc_remove_element("vc_wp_pages");
vc_remove_element("vc_wp_tagcloud");
vc_remove_element("vc_wp_custommenu");
vc_remove_element("vc_wp_text");
vc_remove_element("vc_wp_posts");
vc_remove_element("vc_wp_links");
vc_remove_element("vc_wp_categories");
vc_remove_element("vc_wp_archives");
vc_remove_element("vc_wp_rss");
//vc_remove_element("vc_btn");
vc_remove_element("vc_masonry_grid");
vc_remove_element("vc_basic_grid");
vc_remove_element("vc_posts_slider");
vc_remove_element("woocommerce_cart");
$attributes_vc_gallery = array(
'type' => 'dropdown',
'heading' => __( 'On click', 'toppic' ),
'param_name' => 'onclick',
'value' => array(
__( 'Open lightbox', 'toppic' ) => 'link_image',
__( 'Do nothing', 'toppic' ) => 'link_no',
__( 'Open custom link', 'toppic' ) => 'custom_link'
),
'description' => __( 'Define action for onclick event if needed.', 'toppic' )
);
vc_add_param( 'vc_gallery', $attributes_vc_gallery, 1 );
$attributes_vc_images_carousel = array(
'type' => 'dropdown',
'heading' => __( 'On click', 'toppic' ),
'param_name' => 'onclick',
'value' => array(
__( 'Open lightbox', 'toppic' ) => 'link_image',
__( 'Do nothing', 'toppic' ) => 'link_no',
__( 'Open custom link', 'toppic' ) => 'custom_link'
),
'description' => __( 'What to do when slide is clicked?', 'toppic' )
);
vc_add_param( 'vc_images_carousel', $attributes_vc_images_carousel, 1 );
/* --- Button shortcode--- */
vc_map( array(
'name' => __( 'Button', 'toppic' ),
'base' => 'kk_button',
'icon' => 'icon-wpb-ui-button',
'category' => __( 'Content', 'toppic' ),
'params' => array(
array(
'type' => 'textfield',
'heading' => __( 'Text', 'toppic' ),
'save_always' => true,
'param_name' => 'title',
'value' => __( 'Text on the button', 'toppic' ),
),
array(
'type' => 'vc_link',
'heading' => __( 'URL (Link)', 'toppic' ),
'param_name' => 'link',
'description' => __( 'Add link to button.', 'toppic' ),
// compatible with btn2 and converted from href{btn1}
),
array(
'type' => 'dropdown',
'heading' => __( 'Size', 'toppic' ),
'param_name' => 'size',
'description' => __( 'Select button display size.', 'toppic' ),
// compatible with btn2, default md, but need to be converted from btn1 to btn2
'std' => 'kk-me',
'value' => array(
__( 'Large', 'toppic' ) => 'kk-lg',
__( 'Medium', 'toppic' ) => 'kk-me',
__( 'Small', 'toppic' ) => 'kk-sm',
),
),
),
));
?>