­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ === Basic Shortcodes === Contributors: codesupplyco Donate link: https://codesupply.co/donate/ Tags: shortcodes, bootstrap Requires at least: 3.0.1 Tested up to: 3.4 Stable tag: 4.3 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html == Register Shortcode == To add your shortcode to the Basic Shortcodes elements list, bsc_register_shortcode() function should be called with an array of special attributes describing your shortcode. Parameters: $params Associative array which holds instructions for Basic Shortcodes and is used in "mapping" process. * name String Slug of a new tab in the Basic Shortcodes popup. * title String Name of your shortcode for human reading inside element list. * priority Int The position in the tabs order this one should appear. * base String Shortcode tag. For [my_shortcode] shortcode base is my_shortcode. * autoregister String How to register shortcode for frontend. Automaticly and use a filter 'BASE_shortcode' or by default: add_shortcode(). * fields Array List of shortcode attributes. Array which holds your shortcode params, these params will be editable in shortcode settings page. Fields: Here you should describe all you shortcode's attributes that should be editable with Basic Shortcodes interface. Each shortcode's attribute should be described in separate array element. Defining "Text" attribute: 'input', 'name' => 'title', 'label' => esc_html__( 'Title', 'basic-shortcodes' ), 'default' => 'Default Text Value', 'desc' => '', 'attrs' => array(), ) ?> Available field types: * section Section field. Will be visible in shortcode's edit screen. * input Simple input field * textarea Textarea field * select Select field * radio Radio Buttons Field * checkbox Creates checkbox * content Textarea field for shortcode's content * repeater Field for repeating a set of fields. General params: * type String(required) Attribute type. In the "Available field types" table you can see all available variations * name String(required) Must be the same as your parameter name * label String(required) Human friendly title of your param. Will be visible in shortcode's edit screen * default String(optional) Default attribute's value * desc String(optional) Human friendly description of your param. Will be visible in shortcode's edit screen * attrs Array(optional) Array of field's attributes(eg class, id). Individual field type params: * style String For "radio" type. Values: vertical, horizontal. * suffix String For "input" type. Text after textfield. * fields Array For "repeater" type. The list of fields is identical to the list of shortcode fields. * options Array For "select", "radio" types. List of field values. Value example: array( 'primary' => esc_html__( 'Primary', 'basic-shortcodes' ), 'secondary' => esc_html__( 'Secondary', 'basic-shortcodes' ), ) ?> == Add Shortcode Content on Front-end == Use the filter to output the shortcode content (if you set 'autoregister' param) or by the default add_shortcode hook. Variables $atts and $content are already formed according to the registered fields for the shortcode. For example: %s', $atts['size'], $atts['style'], $atts['url'], $atts['target'], $nofollow, $atts['title'] ); return $output; } add_filter( 'bsc_button_shortcode', 'bsc_button_shortcode', 10, 3 ); ?> == Other Filters == * bsc_theme_autoload_path String Use custom shortcodes path for a theme. Default: 'framework/shortcodes'. * bsc_ui_args Array List of all Shortcodes. Used in the bsc_register_shortcode function. * bsc_enqueue_styles bool Include front-end Bootstrap styles. Default: true. * bsc_enqueue_scripts bool Include front-end Bootstrap scripts. Default: true.