Unyson shortcodes are automatically translated to Visual Composer shortcodes by Visual Composer extension.
Important
Visual Composer extension has to be activated in wp-admin Unyson settings menu.
You can read about Visual Composer shortcode related settings at Visual Composer Integration
Should you need to modify an existing VC shortcode, this filter may be of help.
Here’s an example code which adds text
option to existing ct_button
and ct_icon
shortcodes
(in theme-plugin/extensions/visual-composer/hooks.php
file) :
<?php
/** Visual composer related hooks, ie. add/modify VC shortcode options */
add_filter( '_filter_fw_visual_composer_extend_shortcodes', 'fw_ext_visual_composer_extend_shortcodes' );
function fw_ext_visual_composer_extend_shortcodes( $shortcodes_params ) {
$shortcodes_params['ct_button'] = array(
'my_title' => array(
'type' => 'text',
'label' => esc_html__( 'Title', 'ct_theme' ),
'value' => 'My title',
)
);
$shortcodes_params['ct_icon'] = array(
'my_title' => array(
'type' => 'text',
'label' => esc_html__( 'Title', 'ct_theme' ),
'value' => 'My title',
)
);
return $shortcodes_params;
}
You can skip mapping for selected shortcodes so they won’t show up in VC Editor. This is helpful for
hiding shortcodes you only use for widgets. Use fw_ext_visual_composer_map_skip_shortcodes
filter for that.
Example:
add_filter( 'fw_ext_visual_composer_map_skip_shortcodes', 'ct_bee_fw_filter_visual_composer_map_skip_shortcodes' );
function ct_bee_fw_filter_visual_composer_map_skip_shortcodes( $shortcodes ) {
array_push( $shortcodes, 'ct_flickr', 'ct_twitter', 'ct_latest_news', 'ct_socials' );
return $shortcodes;
}
You can filter every shortcode options before they are mapped to Visual Composer.
If you use css_editor
type shortcode param in pair with shortcode
type shortcode option, JS conflict may occur.
Therefore, the default behaviour is to skip css_editor
param inheritance. With this hook you can change that behaviour,
though it is not recommended.
The following grid item elements are available as part of Bumblebee
This elements displays current post’s taxonomy terms. To add it to a grid item, go to Visual Composer -> Grid Builder and add a Post Taxonomy element. There, you will be able define taxonomy name and number of terms to display.