Action: swifty_register_shortcodes

Plugins can provide SCC with information how their shortcodes can be inserted and edited.

This action is called by SCC for plugins to register their shortcodes with the action ‘swifty_register_shortcode’.

Example:

dd_action('swifty_register_shortcodes', function() {
   /**
    * add this asset as shortcode
    */
   do_action( 'swifty_register_shortcode', array( ..... ) );
}

Action: swifty_register_shortcode

Plugins can provide SCC with information how their shortcodes can be inserted and edited.

By using this action you can provide the information needed to show the edit panel with attributes. The proper moment to
use this action is in the swifty_register_shortcodes action which is called by SCC after loading the plugins.
There is 1 argument which is a array which can contain the following keys:
shortcode: required, shortcode for which the edit panel will be created
name: required, name used in the edit panel
type: optional, [block,inline] default block, shorcode generated html is blocking or inline
category: [clipboard,interactive,textual,layout,others,presets,visuals,thirdparty]
icon: Unicode character or font-awesome name to show as icon on the insertion button
order: order nr of shortcodes in this category
width: default 100, width of generated html in percent
onchange: [‘checkimages’] optional, see description below
vars: array with attributes of the shortcode and how they can be edited

onchange options These are functions called when a attribute is changed in the edit panel, any function without
parameters can be used.
‘checkimages’: shortcode creates img tags which uses the swifty responsive images system
vars attribute
default: default values, can be a string or integer
type: [swifty_form_input,colorpicker,radiobutton,textarea,color_default,hide,iconpicker,checkbox,link,icon_button,select,page] default swifty_form_input
values for radiobutton,select: string with items to show, | separates items, item= value^name
default_var for color_default: attribute to use as default color value
action for icon_button: [‘select_image’] action to perform when clicked
button_size for icon_button: [‘small’]
label: text with the label to show for this attribute
text: text on control for this attribute
tooltip: tooltip for this attribute
column: [0,-] location in edit panel
row: [0,1] location in edit panel
direction: [‘vertical’]
width: width for this edit field
content_removep: [‘0′,’1’] default ‘0’, when ‘1’ call removeautop, wpautop on content when setting / getting depending on the autop setting in the scc options
use_edit_placeholder: [‘0′,’1’] default ‘0’, when ‘1’ show placeholder instead of html when editing

Example:

dd_action('swifty_register_shortcodes', function() {
   /**
    * add this asset as shortcode
    */
   do_action( 'swifty_register_shortcode', array(
       'shortcode' => 'swifty_divider',
       'name' => __( 'Divider', 'swifty-content-creator' ),
       'type' => 'block',
       'category' => 'layout',
       'icon' => 'fa-minus',
       'order' => '10',
       'width' => '100',
       'vars' => array(
           'divider_bg_color' => array(
               'default' => '#404040',
               'type' => 'colorpicker',
               'label' => __( 'Background color', 'swifty-content-creator' ),
               'column' => 0,
               'row' => 0//,
           ),
           'divider_height' => array(
               'default' => '1',
               'label' => __( 'Height', 'swifty-content-creator' ),
               'column' => 0,
               'row' => 1,
               'width' => 100
           ),
       )
   ) );
 );