Exemplo n.º 1
0
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        return '<div class="row ' . $custom_class . '">' . do_shortcode($content) . '</div>';
    }
    add_shortcode('lsvr_grid_row', 'lsvr_grid_row_shortcode');
    add_shortcode('lsvr_grid_row2', 'lsvr_grid_row_shortcode');
    add_shortcode('lsvr_grid_row3', 'lsvr_grid_row_shortcode');
    add_shortcode('lsvr_grid_row4', 'lsvr_grid_row_shortcode');
}
/* -----------------------------------------------------------------------------

    GRID COLUMN

----------------------------------------------------------------------------- */
if (!lsvr_shortcode_exists('lsvr_grid_column') && !function_exists('lsvr_grid_column_shortcode')) {
    function lsvr_grid_column_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_grid_column' => array('name' => __('Grid Column', 'lsvr-toolkit'), 'description' => __('<strong>Grid Column</strong> must be used inside <strong>Grid Row</strong> shortcode.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'nesting' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4), 'atts' => array('size' => array('label' => __('Size', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6, '7' => 7, '8' => 8, '9' => 9, '10' => 10, '11' => 11, '12' => 12), 'default' => '6'), 'breakpoint' => array('label' => __('Breakpoint', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('xs' => __('Do not collapse', 'lsvr-toolkit'), 'sm' => __('Collapse under 768px', 'lsvr-toolkit'), 'md' => __('Collapse under 992px', 'lsvr-toolkit'), 'lg' => __('Collapse under 1200px', 'lsvr-toolkit')), 'default' => 'md'), 'offset' => array('label' => __('Offset', 'lsvr-toolkit'), 'type' => 'select', 'values' => array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
Exemplo n.º 2
0
<?php

if (!lsvr_shortcode_exists('lsvr_custom_object') && !function_exists('lsvr_custom_object_shortcode')) {
    function lsvr_custom_object_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_custom_object' => array('name' => __('Custom Object', 'lsvr-toolkit'), 'description' => __('<strong>Custom Object</strong> doesn\'t have any default styles or functionality. It can be used for grouping multiple components.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('inview_anim' => 'none', 'custom_class' => ''), $atts);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
        $classes = $custom_class;
Exemplo n.º 3
0
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
        $classes = $custom_class;
        $classes .= ' ' . $inview_anim_class;
        $classes = trim(preg_replace('/\\s+/', ' ', $classes));
        return '<ul class="c-list ' . $classes . '"' . $inview_anim_data . '>' . do_shortcode($content) . '</ul>';
    }
    add_shortcode('lsvr_list', 'lsvr_list_shortcode');
}
/* -----------------------------------------------------------------------------

    LIST ITEM

----------------------------------------------------------------------------- */
if (!lsvr_shortcode_exists('lsvr_list_item') && !function_exists('lsvr_list_item_shortcode')) {
    function lsvr_list_item_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_list_item' => array('name' => __('List Item', 'lsvr-toolkit'), 'description' => __('<strong>List Item</strong> should be put inside <strong>List</strong> shortcode.', 'lsvr-toolkit'), 'paired' => true, 'inline' => true, 'atts' => array('icon' => array('label' => __('Icon', 'lsvr-toolkit'), 'description' => __('Name of the icon (e.g. "fa fa-heart"). You will find list of all icons in the documentation.', 'lsvr-toolkit'), 'type' => 'text'), 'icon_color' => array('label' => __('Icon Color', 'lsvr-toolkit'), 'description' => __('For example "#232323", or use the color picker.', 'lsvr-toolkit'), 'type' => 'color'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
Exemplo n.º 4
0
<?php

if (!lsvr_shortcode_exists('lsvr_alert_message') && !function_exists('lsvr_alert_message_shortcode')) {
    function lsvr_alert_message_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_alert_message' => array('name' => __('Alert Message', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('type' => array('label' => __('Type', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('warning' => __('Warning', 'lsvr-toolkit'), 'success' => __('Success', 'lsvr-toolkit'), 'info' => __('Info', 'lsvr-toolkit'), 'notification' => __('Notification', 'lsvr-toolkit'))), 'closable' => array('label' => __('Closable', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'no'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('type' => 'warning', 'closable' => 'no', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $type = esc_attr($args['type']);
        $closable = esc_attr($args['closable']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
Exemplo n.º 5
0
<?php

if (!lsvr_shortcode_exists('lsvr_section') && !function_exists('lsvr_section_shortcode')) {
    function lsvr_section_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_section' => array('name' => __('Section', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('title' => array('label' => __('Title', 'lsvr-toolkit'), 'type' => 'text'), 'subtitle' => array('label' => __('Subtitle', 'lsvr-toolkit'), 'type' => 'text'), 'button_label' => array('label' => __('Button Label', 'lsvr-toolkit'), 'type' => 'text'), 'button_link' => array('label' => __('Button Link', 'lsvr-toolkit'), 'type' => 'text'), 'fullsize' => array('label' => __('Fullsize', 'lsvr-toolkit'), 'description' => __('Set "yes" if this section is used in fullsize template.', 'lsvr-toolkit'), 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'type' => 'select', 'default' => 'no'), 'wrap_in_container' => array('label' => __('Wrap Content in Container', 'lsvr-toolkit'), 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'type' => 'select', 'default' => 'no'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'), 'custom_id' => array('label' => __('Custom ID', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('fullsize' => 'no', 'wrap_in_container' => 'no', 'title' => '', 'subtitle' => '', 'button_label' => '', 'button_link' => '', 'inview_anim' => 'none', 'custom_class' => '', 'custom_id' => ''), $atts);
        $fullsize = esc_attr($args['fullsize']);
        $wrap_in_container = esc_attr($args['wrap_in_container']);
        $title = $args['title'];
        $subtitle = $args['subtitle'];
        $button_label = esc_attr($args['button_label']);
        $button_link = esc_url($args['button_link']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
Exemplo n.º 6
0
<?php

if (!lsvr_shortcode_exists('lsvr_container') && !function_exists('lsvr_container_shortcode')) {
    function lsvr_container_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_container' => array('name' => __('Container', 'lsvr-toolkit'), 'description' => __('For use inside fullsize templates to center the content.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('inview_anim' => 'none', 'custom_class' => ''), $atts);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
        $classes = $custom_class;
Exemplo n.º 7
0
        $tab_contents = do_shortcode($content);
        foreach ($lsvr_tabs_sc_temp as $tab) {
            $active = $tab === reset($lsvr_tabs_sc_temp) ? ' m-active' : '';
            $title = $tab['title'] != '' ? '<span class="tab-label">' . $tab['title'] . '</span>' : '';
            $html .= '<li class="tab' . $active . '">' . $title . '</li>';
        }
        $lsvr_tabs_sc_temp = array();
        $html .= '</ul><ul class="content-list">' . $tab_contents . '</ul></div>';
        return $html;
    }
    add_shortcode('lsvr_tabs', 'lsvr_tabs_shortcode');
}
/* -----------------------------------------------------------------------------
    TABS ITEM
----------------------------------------------------------------------------- */
if (!lsvr_shortcode_exists('lsvr_tab_item') && !function_exists('lsvr_tabs_item_shortcode')) {
    function lsvr_tabs_item_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_tab_item' => array('name' => __('Tab Item', 'lsvr-toolkit'), 'description' => __('<strong>Tab Item</strong> should be put inside <strong>Tabs</strong> shortcode.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('title' => array('label' => __('Title', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
Exemplo n.º 8
0
<?php

if (!lsvr_shortcode_exists('lsvr_image') && !function_exists('lsvr_image_shortcode')) {
    function lsvr_image_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_image' => array('name' => __('Image', 'lsvr-toolkit'), 'paired' => false, 'inline' => true, 'atts' => array('image' => array('label' => __('Upload Image', 'lsvr-toolkit'), 'type' => 'file'), 'link' => array('label' => __('Link', 'lsvr-toolkit'), 'type' => 'text'), 'lightbox' => array('label' => __('Open In Lightbox', 'lsvr-toolkit'), 'description' => __('URL of the lightbox image must be placed in "Link" field.', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'no'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('image' => '', 'link' => '', 'lightbox' => 'no', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $image = esc_url($args['image']);
        $link = esc_url($args['link']);
        $lightbox = esc_attr($args['lightbox']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
Exemplo n.º 9
0
<?php

if (!lsvr_shortcode_exists('lsvr_video') && !function_exists('lsvr_video_shortcode')) {
    function lsvr_video_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_video' => array('name' => __('Video', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'description' => __('Insert the embed code of the video inside the shortcode (after clicking on \\"Add Shortcode\\").', 'lsvr-toolkit'), 'atts' => array('inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('inview_anim' => 'none', 'custom_class' => ''), $atts);
        //$embed_code = htmlspecialchars( $args['embed_code'] );
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
Exemplo n.º 10
0
<?php

if (!lsvr_shortcode_exists('lsvr_pricing_table') && !function_exists('lsvr_pricing_table_shortcode')) {
    function lsvr_pricing_table_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_pricing_table' => array('name' => __('Pricing Table', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('title' => array('label' => __('Title', 'lsvr-toolkit'), 'type' => 'text'), 'price' => array('label' => __('Price', 'lsvr-toolkit'), 'type' => 'text'), 'price_description' => array('label' => __('Price Description', 'lsvr-toolkit'), 'type' => 'text'), 'button_label' => array('label' => __('Button Label', 'lsvr-toolkit'), 'type' => 'text'), 'button_link' => array('label' => __('Button Link', 'lsvr-toolkit'), 'type' => 'text'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('title' => '', 'price' => '', 'price_description' => '', 'button_label' => '', 'button_link' => '', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $title = $args['title'];
        $price = esc_attr($args['price']);
        $price_description = $args['price_description'];
        $button_label = $args['button_label'];
        $button_link = esc_attr($args['button_link']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
Exemplo n.º 11
0
<?php

if (!lsvr_shortcode_exists('lsvr_carousel') && !function_exists('lsvr_carousel_shortcode')) {
    function lsvr_carousel_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_carousel' => array('name' => __('Carousel', 'lsvr-toolkit'), 'description' => __('<strong>Carousel</strong> is mainly used to divide similar elements into multiple slides.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('wrap_in_container' => array('label' => __('Wrap in Container', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'no'), 'transparent_bg' => array('label' => __('Transparent Background', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'yes'), 'bg_color' => array('label' => __('Background Color', 'lsvr-toolkit'), 'type' => 'color', 'description' => __('If you set "Transparent Background" option to "No" and leave this field blank, default color will be used.', 'lsvr-toolkit')), 'items_per_slide' => array('label' => __('Items Per Slide', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'items_per_slide_desktop' => array('label' => __('Items Per Slide Under 1200px', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'items_per_slide_smalldesktop' => array('label' => __('Items Per Slide Under 992px', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'items_per_slide_tablet' => array('label' => __('Items Per Slide Under 768px', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'items_per_slide_mobile' => array('label' => __('Items Per Slide Under 481px', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('wrap_in_container' => 'no', 'transparent_bg' => 'yes', 'bg_color' => '', 'items_per_slide' => 1, 'items_per_slide_desktop' => 1, 'items_per_slide_smalldesktop' => 1, 'items_per_slide_tablet' => 1, 'items_per_slide_mobile' => 1, 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $wrap_in_container = esc_attr($args['wrap_in_container']);
        $transparent_bg = esc_attr($args['transparent_bg']);
        $bg_color = esc_attr($args['bg_color']);
        $bg_color = $bg_color !== '' && is_string($bg_color) && $bg_color[0] !== '#' ? '#' . $bg_color : '';
        $items_per_slide = (int) $args['items_per_slide'];
        $items_per_slide_desktop = (int) $args['items_per_slide_desktop'];
        $items_per_slide_smalldesktop = (int) $args['items_per_slide_smalldesktop'];
        $items_per_slide_tablet = (int) $args['items_per_slide_tablet'];
Exemplo n.º 12
0
<?php

if (!lsvr_shortcode_exists('lsvr_testimonial') && !function_exists('lsvr_testimonial_shortcode')) {
    function lsvr_testimonial_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_testimonial' => array('name' => __('Testimonial', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('portrait' => array('label' => __('Portrait', 'lsvr-toolkit'), 'type' => 'file'), 'source' => array('label' => __('Source', 'lsvr-toolkit'), 'description' => __('You can use some HTML for this field, for example:<br>&lt;strong&gt;John Doe&lt;/strong&gt;, Manager', 'lsvr-toolkit'), 'type' => 'text'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('portrait' => '', 'source' => '', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $portrait = esc_url($args['portrait']);
        $source = $args['source'];
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
Exemplo n.º 13
0
<?php

if (!lsvr_shortcode_exists('lsvr_gallery') && !function_exists('lsvr_gallery_shortcode')) {
    function lsvr_gallery_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_gallery' => array('name' => __('Gallery', 'lsvr-toolkit'), 'description' => __('Insert any number of images into this shortcode.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('carousel' => array('label' => __('Display as Carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'no'), 'items_per_slide' => array('label' => __('Items per slide if displayed as carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '4'), 'items_per_slide_desktop' => array('label' => __('Items per slide under 1200px if displayed as carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '4'), 'items_per_slide_smalldesktop' => array('label' => __('Items per slide under 992px if displayed as carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '3'), 'items_per_slide_tablet' => array('label' => __('Items per slide under 768px if displayed as carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '2'), 'items_per_slide_mobile' => array('label' => __('Items per slide under 481px if displayed as carousel', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4, '5' => 5, '6' => 6), 'default' => '1'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('carousel' => 'no', 'items_per_slide' => 4, 'items_per_slide_desktop' => 4, 'items_per_slide_smalldesktop' => 3, 'items_per_slide_tablet' => 2, 'items_per_slide_mobile' => 1, 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $carousel = esc_attr($args['carousel']);
        $items_per_slide = (int) $args['items_per_slide'];
        $items_per_slide_desktop = (int) $args['items_per_slide_desktop'];
        $items_per_slide_smalldesktop = (int) $args['items_per_slide_smalldesktop'];
        $items_per_slide_tablet = (int) $args['items_per_slide_tablet'];
        $items_per_slide_mobile = (int) $args['items_per_slide_mobile'];
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
Exemplo n.º 14
0
<?php

if (!lsvr_shortcode_exists('lsvr_articles') && !function_exists('lsvr_articles_shortcode')) {
    function lsvr_articles_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
        
                    Output shortcode info for shortcode generator
        
                --------------------------------------------------------------------- */
        if ($generator === true) {
            $shortcode_data = array('lsvr_articles' => array('name' => __('Articles', 'lsvr-toolkit'), 'description' => __('Lists posts from specified category.', 'lsvr-toolkit'), 'paired' => false, 'inline' => false, 'atts' => array('number_of_items' => array('label' => __('Number of Posts', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('1' => 1, '2' => 2, '3' => 3, '4' => 4), 'default' => '4'), 'show_post_date' => array('label' => __('Show Post Date', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('show' => __('Show', 'lsvr-toolkit'), 'hide' => __('Hide', 'lsvr-toolkit')), 'default' => 'show'), 'show_post_media' => array('label' => __('Show Featured Image', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('show' => __('Show', 'lsvr-toolkit'), 'hide' => __('Hide', 'lsvr-toolkit')), 'default' => 'show'), 'show_post_excerpt' => array('label' => __('Show Post Excerpt', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('show' => __('Show', 'lsvr-toolkit'), 'hide' => __('Hide', 'lsvr-toolkit')), 'default' => 'show'), 'excerpt_length' => array('label' => __('Excerpt Length', 'lsvr-toolkit'), 'type' => 'text', 'default' => 40), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
            // CHECK FOR CATEGORIES
            $categories_tax = get_categories('hide_empty=1&hierarchical=0&parent=0');
            if (count($categories_tax) > 0) {
                $values = array('none' => __('None', 'lsvr-toolkit'));
                foreach ($categories_tax as $value) {
                    $values[$value->slug] = $value->name;
                }
                $att_data = array('label' => __('Category', 'lsvr-toolkit'), 'description' => __('Category to load posts from. Choose <strong>None</strong> to load posts regardless of category.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $values, 'default' => 'none');
                $shortcode_atts_arr = $shortcode_data['lsvr_articles']['atts'];
                $shortcode_atts_arr = array_splice($shortcode_atts_arr, 0, 1, true) + array('category' => $att_data) + array_slice($shortcode_atts_arr, 1, count($shortcode_atts_arr) - 1, true);
                $shortcode_data['lsvr_articles']['atts'] = $shortcode_atts_arr;
            }
            return $shortcode_data;
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
Exemplo n.º 15
0
<?php

if (!lsvr_shortcode_exists('lsvr_team_member') && !function_exists('lsvr_team_member_shortcode')) {
    function lsvr_team_member_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_team_member' => array('name' => __('Team Member', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('portrait' => array('label' => __('Portrait', 'lsvr-toolkit'), 'type' => 'file'), 'person_name' => array('label' => __('Name', 'lsvr-toolkit'), 'type' => 'text'), 'description' => array('label' => __('Description', 'lsvr-toolkit'), 'type' => 'text'), 'social_icons' => array('label' => __('Social Icons', 'lsvr-toolkit'), 'description' => __('Use the following pattern for adding social icons: "<strong>icon_class1,link1|icon_class2,link2</strong>".<br>For example: "<strong>fa fa-twitter,https://twitter.com/MyTwitterProfile|fa fa-facebook,https://www.facebook.com/MyTwitterProfile</strong>".', 'lsvr-toolkit'), 'type' => 'text'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('portrait' => '', 'person_name' => '', 'description' => '', 'social_icons' => '', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $portrait = esc_url($args['portrait']);
        $person_name = $args['person_name'];
        $description = $args['description'];
        $social_icons = $args['social_icons'];
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
Exemplo n.º 16
0
<?php

if (!lsvr_shortcode_exists('lsvr_icon_block') && !function_exists('lsvr_icon_block_shortcode')) {
    function lsvr_icon_block_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_icon_block' => array('name' => __('Icon Block', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('icon' => array('label' => __('Icon', 'lsvr-toolkit'), 'description' => __('Name of the icon (e.g. "fa fa-heart"). Please refer to the documentation to learn more about using the icons.', 'lsvr-toolkit'), 'type' => 'text'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('icon' => '', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $icon = esc_attr($args['icon']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
Exemplo n.º 17
0
<?php

if (!lsvr_shortcode_exists('lsvr_lead') && !function_exists('lsvr_lead_shortcode')) {
    function lsvr_lead_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_lead' => array('name' => __('Lead Paragraph', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('inview_anim' => 'none', 'custom_class' => ''), $atts);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
        $classes = $custom_class;
Exemplo n.º 18
0
<?php

if (!lsvr_shortcode_exists('lsvr_service') && !function_exists('lsvr_feature_shortcode')) {
    function lsvr_feature_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_service' => array('name' => __('Service', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('image' => array('label' => __('Image', 'lsvr-toolkit'), 'type' => 'file', 'default' => ''), 'title' => array('label' => __('Title', 'lsvr-toolkit'), 'type' => 'text'), 'link' => array('label' => __('Link', 'lsvr-toolkit'), 'type' => 'text'), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('Animation fired when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('image' => '', 'title' => '', 'link' => '', 'inview_anim' => '', 'custom_class' => ''), $atts);
        $image = esc_url($args['image']);
        $title = esc_attr($args['title']);
        $link = esc_attr($args['link']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */
Exemplo n.º 19
0
               Generate HTML
           --------------------------------------------------------------------- */
        $inview_anim_data = $inview_anim !== '' && $inview_anim !== 'none' ? ' data-inview-anim="' . $inview_anim . '" ' : '';
        $inview_anim_class = $inview_anim !== '' && $inview_anim !== 'none' && !in_array($inview_anim, $lsvr_inview_animations_visible) ? 'visibility-hidden' : '';
        $classes = $custom_class;
        $classes .= $toggle === 'yes' ? ' m-toggle' : '';
        $classes .= ' ' . $inview_anim_class;
        $classes = trim(preg_replace('/\\s+/', ' ', $classes));
        return '<ul class="c-accordion ' . $classes . '"' . $inview_anim_data . '>' . do_shortcode($content) . '</ul>';
    }
    add_shortcode('lsvr_accordion', 'lsvr_accordion_shortcode');
}
/* -----------------------------------------------------------------------------
    ACCORDION ITEM
----------------------------------------------------------------------------- */
if (!lsvr_shortcode_exists('lsvr_accordion_item') && !function_exists('lsvr_accordion_item_shortcode')) {
    function lsvr_accordion_item_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_accordion_item' => array('name' => __('Accordion Item', 'lsvr-toolkit'), 'description' => __('Must be placed inside <strong>Accordion</strong> shortcode.', 'lsvr-toolkit'), 'paired' => true, 'inline' => false, 'atts' => array('title' => array('label' => __('Title', 'lsvr-toolkit'), 'type' => 'text'), 'price' => array('label' => __('Price Info', 'lsvr-toolkit'), 'type' => 'text'), 'oldprice' => array('label' => __('Old Price Info', 'lsvr-toolkit'), 'type' => 'text'), 'state' => array('label' => __('State', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('closed' => __('Closed', 'lsvr-toolkit'), 'opened' => __('Opened', 'lsvr-toolkit')), 'default' => 'closed'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
Exemplo n.º 20
0
<?php

if (!lsvr_shortcode_exists('lsvr_slider') && !function_exists('lsvr_slider_shortcode')) {
    function lsvr_slider_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        if (post_type_exists('lsvrslide')) {
            /* ---------------------------------------------------------------------
                   Output shortcode info for shortcode generator
               --------------------------------------------------------------------- */
            if ($generator === true) {
                $shortcode_data = array('lsvr_slider' => array('name' => __('Slider', 'lsvr-toolkit'), 'description' => __('Basic slider. Slides can be managed under <strong>Slider</strong> section of main menu.', 'lsvr-toolkit'), 'paired' => false, 'inline' => false, 'atts' => array('fullsize' => array('label' => __('Fullsize', 'lsvr-toolkit'), 'description' => __('Select "Yes" if you are using this slider in Fullsize template.', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('yes' => __('Yes', 'lsvr-toolkit'), 'no' => __('No', 'lsvr-toolkit')), 'default' => 'no'), 'interval' => array('label' => __('Autoplay Speed', 'lsvr-toolkit'), 'description' => __('Duration between transitions in seconds. Add 0 to disable automatic slideshow.', 'lsvr-toolkit'), 'type' => 'text', 'default' => 0), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
                // check for slider taxonomy terms
                $slides_group_tax = get_terms('lsvrslider', 'hide_empty=0&hierarchical=0&parent=0');
                if (count($slides_group_tax) > 0) {
                    $values = array('none' => 'None');
                    foreach ($slides_group_tax as $value) {
                        $values[$value->slug] = $value->name;
                    }
                    $att_data = array('label' => __('Slider', 'lsvr-toolkit'), 'description' => __('Which slider will be used. You can manage sliders under <strong>Dashboard / Slides / Sliders</strong>. Choose <strong>None</strong> to load all slides.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $values, 'default' => 'none');
                    $shortcode_data['lsvr_slider']['atts'] = array_merge(array('slider' => $att_data), $shortcode_data['lsvr_slider']['atts']);
                }
                return $shortcode_data;
            }
            /* ---------------------------------------------------------------------
                   Check if shortcode is inline
               --------------------------------------------------------------------- */
            if ($check_if_inline === true) {
                return false;
            }
            /* ---------------------------------------------------------------------
                   Prepare arguments
Exemplo n.º 21
0
<?php

if (!lsvr_shortcode_exists('lsvr_progressbar') && !function_exists('lsvr_progressbar_shortcode')) {
    function lsvr_progressbar_shortcode($atts, $content = null, $generator = false, $check_if_inline = false)
    {
        global $lsvr_inview_animations;
        global $lsvr_inview_animations_visible;
        /* ---------------------------------------------------------------------
               Output shortcode info for shortcode generator
           --------------------------------------------------------------------- */
        if ($generator === true) {
            return array('lsvr_progressbar' => array('name' => __('Progress Bar', 'lsvr-toolkit'), 'paired' => false, 'inline' => false, 'atts' => array('percentage' => array('label' => __('Percentage', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('0' => 0, '5' => 5, '10' => 10, '15' => 15, '20' => 20, '25' => 25, '30' => 30, '35' => 35, '40' => 40, '45' => 45, '50' => 50, '55' => 55, '60' => 60, '65' => 65, '70' => 70, '75' => 75, '80' => 80, '85' => 85, '90' => 90, '95' => 95, '100' => 100), 'default' => '100'), 'label' => array('label' => __('Label', 'lsvr-toolkit'), 'type' => 'text'), 'color' => array('label' => __('Style', 'lsvr-toolkit'), 'type' => 'select', 'values' => array('m-color-1' => 'Color 1', 'm-color-2' => 'Color 2', 'm-color-3' => 'Color 3')), 'inview_anim' => array('label' => __('InView Animation', 'lsvr-toolkit'), 'description' => __('This animation will fire when element appears in the user\'s viewport.', 'lsvr-toolkit'), 'type' => 'select', 'values' => $lsvr_inview_animations, 'default' => 'none'), 'custom_class' => array('label' => __('Custom Class', 'lsvr-toolkit'), 'description' => __('It can be used for applying custom CSS.', 'lsvr-toolkit'), 'type' => 'text'))));
        }
        /* ---------------------------------------------------------------------
               Check if shortcode is inline
           --------------------------------------------------------------------- */
        if ($check_if_inline === true) {
            return false;
        }
        /* ---------------------------------------------------------------------
               Prepare arguments
           --------------------------------------------------------------------- */
        $args = shortcode_atts(array('percentage' => 100, 'label' => '', 'color' => 'm-color-1', 'inview_anim' => 'none', 'custom_class' => ''), $atts);
        $percentage = (int) esc_attr($args['percentage']);
        $label = $args['label'];
        $color = esc_attr($args['color']);
        $inview_anim = esc_attr($args['inview_anim']);
        $custom_class = esc_attr($args['custom_class']);
        /* ---------------------------------------------------------------------
               Generate HTML
           --------------------------------------------------------------------- */