Esempio n. 1
0
            $add_style = wp_kses($add_style, array());
            $add_style = ' style="' . esc_attr($add_style) . '"';
        }
        // Icon Style
        $icon_style = array();
        if ($icon) {
            if ($icon_size) {
                $icon_style[] = 'font-size: ' . $icon_size . ';';
            }
            if ($icon_color && $icon_color !== '#000') {
                $icon_style[] = 'color: ' . $icon_color . ';';
            }
            $icon_style = implode('', $icon_style);
        }
        if ($icon_style) {
            $icon_style = wp_kses($icon_style, array());
            $icon_style = ' style="' . esc_attr($icon_style) . '"';
        }
        // Output
        if ($icon) {
            $output = '<div class="vcex-divider-with-icon ' . $style . ' ' . $class . '" ' . $add_style . '><i class="fa fa-' . $icon . '" ' . $icon_style . '></i></div>';
        } else {
            $output = '<hr class="vcex-divider ' . $style . ' ' . $class . '" ' . $add_style . ' />';
        }
        return $output;
    }
}
add_shortcode('vcex_divider', 'vcex_divider_shortcode');
// Add To Visual Composer -------------------------------------------------------------------------- >
vc_map(array("name" => __("Divider", 'vcex'), "base" => "vcex_divider", "class" => "", "category" => __("Seperators", "wpex"), 'admin_enqueue_js' => "", 'admin_enqueue_css' => "", "icon" => "icon-wpb-vcex-divider", "params" => array(array("type" => "dropdown", "admin_label" => true, "class" => "", "heading" => __("Style", 'vcex'), "param_name" => "style", "value" => array(__("Solid", "wpex") => "solid", __("Dashed", "wpex") => "dashed", __("Dotted", "wpex") => "dotted", __("Double", "wpex") => "double")), array("type" => "dropdown", "class" => "", "heading" => __("Icon", 'vcex'), "param_name" => "icon", "admin_label" => true, "description" => sprintf(__('Select a FontAwesome icon. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()), array("type" => "colorpicker", "class" => "", "heading" => __("Icon Color", 'vcex'), "param_name" => "icon_color", "value" => "#000", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Icon Size", 'vcex'), "param_name" => "icon_size", "value" => "14px", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Margin Top", 'vcex'), "param_name" => "margin_top", "value" => "20px"), array("type" => "textfield", "class" => "", "heading" => __("Margin Bottom", 'vcex'), "param_name" => "margin_bottom", "value" => "20px"))));
Esempio n. 2
0
        //Set Vars
        $button_border_radius = $button_border_radius ? 'style="border-radius:' . $button_border_radius . '"' : NULL;
        $button_rel = $button_rel !== 'none' ? 'rel="' . $button_rel . '"' : NULL;
        // Display Callout
        $output = '<div class="vcex-callout vcex-clearfix ' . $css_animation_classes . '">';
        $output .= '<div class="vcex-callout-caption">';
        $output .= do_shortcode($content);
        $output .= '</div>';
        if ($button_text !== '') {
            $output .= '<div class="vcex-callout-button">';
            $output .= '<a href="' . $button_url . '" class="vcex-button ' . $button_style . ' ' . $button_color . '" target="_' . $button_target . '" title="' . $button_title . '" ' . $button_border_radius . ' ' . $button_rel . '>';
            $output .= '<span class="vcex-button-inner" ' . $button_border_radius . '>';
            if ($button_icon_left && $button_icon_left !== 'none') {
                $output .= '<i class="vcex-button-icon-left fa fa-' . $button_icon_left . '"></i>';
            }
            $output .= $button_text;
            if ($button_icon_right && $button_icon_right !== 'none') {
                $output .= '<i class="vcex-button-icon-right fa fa-' . $button_icon_right . '"></i>';
            }
            $output .= '</span>';
            $output .= '</a>';
            $output .= '</div>';
        }
        $output .= '</div>';
        return $output;
    }
}
add_shortcode('vcex_callout', 'vcex_callout_shortcode');
// Add to Visual Composer -------------------------------------------------------------------------- >
vc_map(array("name" => __("Callout", 'vcex'), "base" => "vcex_callout", "category" => __("Business", "wpex"), "class" => "", 'admin_enqueue_js' => "", 'admin_enqueue_css' => "", "icon" => "icon-wpb-vcex-callout", "params" => array(array("type" => "textarea_html", "holder" => "div", "class" => "vcex-callout", "heading" => __("Callout Content", 'vcex'), "param_name" => "content", "value" => __("Enter your content here.", 'vcex')), array("type" => "dropdown", "heading" => __("CSS Animation", "wpex"), "param_name" => "css_animation", "value" => array(__("No", "wpex") => '', __("Top to bottom", "wpex") => "top-to-bottom", __("Bottom to top", "wpex") => "bottom-to-top", __("Left to right", "wpex") => "left-to-right", __("Right to left", "wpex") => "right-to-left", __("Appear from center", "wpex") => "appear"), "description" => __("Select animation type if you want this element to be animated when it enters into the browsers viewport. Note: Works only in modern browsers.", "wpex")), array("type" => "textfield", "class" => "", "heading" => __("Button: URL", 'vcex'), "param_name" => "button_url", "value" => "http://www.google.com/", "description" => __("Button: URL", 'vcex')), array("type" => "textfield", "class" => "", "heading" => __("Button: Text", 'vcex'), "param_name" => "button_text", "value" => "Button Text"), array("type" => "dropdown", "class" => "", "heading" => __("Button Style", 'vcex'), "param_name" => "button_style", "admin_label" => true, "description" => __("Select a button style.", 'vcex'), "value" => array(__("Graphical", "wpex") => "graphical", __("Flat", "wpex") => "flat", __("3D", "wpex") => "three-d", __("Outline", "wpex") => "outline")), array("type" => "dropdown", "class" => "", "heading" => __("Button: Color", 'vcex'), "param_name" => "button_color", "value" => array(__("Black", "wpex") => "black", __("Blue", "wpex") => "blue", __("Brown", "wpex") => "brown", __("Grey", "wpex") => "grey", __("Green", "wpex") => "green", __("Gold", "wpex") => "gold", __("Orange", "wpex") => "orange", __("Pink", "wpex") => "pink", __("Red", "wpex") => "red", __("Rosy", "wpex") => "rosy", __("Teal", "wpex") => "teal")), array("type" => "textfield", "class" => "", "heading" => __("Button: Border Radius", 'vcex'), "param_name" => "button_border_radius", "value" => "3px"), array("type" => "dropdown", "class" => "", "heading" => __("Button: Link Target", 'vcex'), "param_name" => "button_target", "value" => array(__("Self", "wpex") => "self", __("Blank", "wpex") => "blank")), array("type" => "dropdown", "class" => "", "heading" => __("Button: Rel", 'vcex'), "param_name" => "button_rel", "value" => array(__("None", "wpex") => "none", __("Nofollow", "wpex") => "nofollow")), array("type" => "dropdown", "class" => "", "heading" => __("Button: Icon Left", 'vcex'), "param_name" => "button_icon_left", "description" => sprintf(__('Icon to the left of your button text. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()), array("type" => "dropdown", "class" => "", "heading" => __("Button: Icon Right", 'vcex'), "param_name" => "button_icon_right", "description" => sprintf(__('Icon to the right of your button text. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()))));
Esempio n. 3
0
<?php

// Register Shortcode -------------------------------------------------------------------------- >
if (!function_exists('vcex_icon_shortcode')) {
    function vcex_icon_shortcode($atts, $content = NULL)
    {
        extract(shortcode_atts(array('unique_id' => '', 'icon' => 'cloud', 'style' => 'circle', 'float' => 'left', 'size' => 'normal', 'color' => '#000', 'add_background' => '', 'background' => '', 'border_radius' => '99px', 'css_animation' => ''), $atts));
        $color_css = 'color:' . $color . ';';
        $background_css = $border_radius_css = '';
        if ($add_background == 'yes') {
            $background_css = 'background-color:' . $background . ';';
            $border_radius_css = 'border-radius:' . $border_radius . ';';
        }
        $unique_id = $unique_id ? ' id="' . $unique_id . '"' : NULL;
        $css_animation_classes = '';
        if ($css_animation !== '') {
            $css_animation_classes = 'wpb_animate_when_almost_visible wpb_' . $css_animation . '';
        }
        $remove_dimensions = '';
        if ($add_background !== 'yes') {
            $remove_dimensions = 'remove-dimensions';
        }
        $output = '<div class="vcex-icon vcex-icon-' . $style . ' vcex-icon-' . $size . ' vcex-icon-float-' . $float . ' ' . $css_animation_classes . ' ' . $remove_dimensions . '"' . $unique_id . ' style="' . $background_css . $color_css . $border_radius_css . '"><span class="fa fa-' . $icon . '"></span></div>';
        return $output;
    }
}
add_shortcode('vcex_icon', 'vcex_icon_shortcode');
// Add to visual composer -------------------------------------------------------------------------- >
vc_map(array("name" => __("Icon", 'vcex'), "base" => "vcex_icon", "class" => "", "category" => __("Icons", "wpex"), 'admin_enqueue_js' => "", 'admin_enqueue_css' => "", "icon" => "icon-wpb-vcex-icon", "params" => array(array("type" => "dropdown", "class" => "", "heading" => __("Icon", 'vcex'), "param_name" => "icon", "admin_label" => true, "description" => sprintf(__('Select a FontAwesome icon. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()), array("type" => "dropdown", "heading" => __("CSS Animation", "wpex"), "param_name" => "css_animation", "admin_label" => true, "value" => array(__("No", "wpex") => '', __("Top to bottom", "wpex") => "top-to-bottom", __("Bottom to top", "wpex") => "bottom-to-top", __("Left to right", "wpex") => "left-to-right", __("Right to left", "wpex") => "right-to-left", __("Appear from center", "wpex") => "appear"), "description" => __("Select animation type if you want this element to be animated when it enters into the browsers viewport. Note: Works only in modern browsers.", "wpex"), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "dropdown", "class" => "", "heading" => __("Icon Size", 'vcex'), "param_name" => "size", "description" => __("Select an icon size.", 'vcex'), "value" => array(__("Extra Large", "wpex") => "xlarge", __("Large", "wpex") => "large", __("Normal", "wpex") => "normal", __("Small", "wpex") => "small", __("Tiny", "wpex") => "tiny"), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "dropdown", "class" => "", "heading" => __("Float", 'vcex'), "param_name" => "float", "value" => array(__("Center", "wpex") => "center", __("Left", "wpex") => "left", __("Right", "wpex") => "right"), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "colorpicker", "class" => "", "heading" => __("Icon Color", 'vcex'), "param_name" => "color", "value" => "#000000", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => 'checkbox', "heading" => __("Add Background Color?", "wpex"), "param_name" => "add_background", "description" => __("If selected, your icon will have a background color and display as a block.", "wpex"), "value" => array(__("Yes, please", "wpex") => 'yes'), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "colorpicker", "class" => "", "heading" => __("Background Color", 'vcex'), "param_name" => "background", "value" => "", "dependency" => array('element' => "add_background", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Border Radius", 'vcex'), "param_name" => "border_radius", "value" => "99px", "description" => __("Change the background border radius (99px for a circle, down to 0px for a square)", 'vcex'), "dependency" => array('element' => "add_background", 'not_empty' => true)))));
Esempio n. 4
0
            $output .= '<img class="vcex-icon-box-' . $style . '-img-alt" src="' . $image_url . '" alt="' . $heading . '" />';
        } else {
            // Display Icon
            $output .= '<span class="vcex-icon-box-' . $style . '-icon fa fa-' . $icon . ' ' . $icon_background_class . '" ' . $icon_style . '></span>';
        }
        // The heading
        $output .= '<' . $heading_type . ' class="vcex-icon-box-' . $style . '-heading" ' . $heading_style . '>';
        $output .= $heading;
        $output .= '</' . $heading_type . '>';
        // Close link
        if ($url && in_array($style, $standard_boxes)) {
            $output .= '</a>';
        }
        // The box content
        if ($content) {
            $output .= '<div class="vcex-icon-box-' . $style . '-content clr">';
            $output .= $content;
            $output .= '</div>';
        }
        // Close link
        if ($url && in_array($style, $clickable_boxes)) {
            $output .= '</a>';
        }
        $output .= '</article>';
        return $output;
    }
}
add_shortcode('vcex_icon_box', 'vcex_icon_box_shortcode');
// Add to visual composer -------------------------------------------------------------------------- >
vc_map(array("name" => __("Icon Box", 'vcex'), "base" => "vcex_icon_box", "class" => "", "category" => __("Icons", "wpex"), 'admin_enqueue_js' => "", 'admin_enqueue_css' => "", "icon" => "icon-wpb-vcex-icon_box", "params" => array(array("type" => "dropdown", "heading" => __("CSS Animation", "wpex"), "param_name" => "css_animation", "value" => array(__("No", "wpex") => '', __("Top to bottom", "wpex") => "top-to-bottom", __("Bottom to top", "wpex") => "bottom-to-top", __("Left to right", "wpex") => "left-to-right", __("Right to left", "wpex") => "right-to-left", __("Appear from center", "wpex") => "appear"), "description" => __("Select animation type if you want this element to be animated when it enters into the browsers viewport. Note: Works only in modern browsers.", "wpex")), array("type" => "textarea_html", "class" => "", "holder" => "div", "heading" => __("Content", 'vcex'), "param_name" => "content", "value" => __("Don't forget to change this dummy text in your page editor for this lovely icon box.", "wpex")), array("type" => "dropdown", "class" => "", "heading" => __("Icon Box Style", 'vcex'), "param_name" => "style", "description" => __("Select your preferred icon box style", "wpex"), "value" => array(__("Left Icon", "wpex") => "one", __("Top Icon", "wpex") => "two", __("Top Icon & Background", "wpex") => "three", __("Outlined & Top Icon", "wpex") => "four", __("Boxed & Top Icon", "wpex") => "five", __("Boxed & Top Icon & Custom Background Color", "wpex") => "six")), array("type" => "dropdown", "class" => "", "heading" => __("Icon", 'vcex'), "param_name" => "icon", "description" => sprintf(__('Select a FontAwesome icon. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()), array("type" => "attach_image", "heading" => __("Icon Image Alternative", "wpex"), "param_name" => "image", "value" => "", "description" => __("Select an image instead of using a font icon.", "wpex")), array("type" => "colorpicker", "class" => "", "heading" => __("Icon Color", 'vcex'), "param_name" => "icon_color", "value" => "#000000"), array("type" => "colorpicker", "class" => "", "heading" => __("Icon Background", 'vcex'), "param_name" => "icon_background", "value" => "", "description" => __('Note: Not all icon box styles support this setting.', 'vcex'), "dependency" => array('element' => "style", 'value' => array('three', 'six'))), array("type" => "textfield", "class" => "", "heading" => __("Icon Size In Pixels", 'vcex'), "param_name" => "icon_size", "value" => "24px", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Title", 'vcex'), "param_name" => "heading", "value" => "Sample Heading", "description" => __("Enter your custom title here.", "wpex")), array("type" => "dropdown", "class" => "", "heading" => __("Title Heading Type", 'vcex'), "param_name" => "heading_type", "value" => array(__("h2", "wpex") => "h2", __("h3", "wpex") => "h3", __("h4", "wpex") => "h4", __("h5", "wpex") => "h5"), "description" => __("Select your title heading type for SEO reasons.", "wpex")), array("type" => "colorpicker", "class" => "", "heading" => __("Heading Font Color", 'vcex'), "param_name" => "heading_color", "value" => "", "description" => __("Select a custom font color for your title (optional).", "wpex")), array("type" => "textfield", "class" => "", "heading" => __("Title Font Size", 'vcex'), "param_name" => "heading_size", "value" => "", "description" => __("Enter a custom font size in pixels for your title (optional).", "wpex")), array("type" => "textfield", "class" => "", "heading" => __("Title Font Weight", 'vcex'), "param_name" => "heading_weight", "value" => "", "description" => __("Enter a custom font weight for your heading (300,400,600,700).", "wpex")), array("type" => "textfield", "class" => "", "heading" => __("URL", 'vcex'), "param_name" => "url", "value" => ""), array("type" => "dropdown", "class" => "", "heading" => __("URL Target", 'vcex'), "param_name" => "url_target", "value" => array(__("Self", "wpex") => "_self", __("Blank", "wpex") => "_blank"), "dependency" => array('element' => "url", 'not_empty' => true)), array("type" => "dropdown", "class" => "", "heading" => __("URL Rel", 'vcex'), "param_name" => "url_rel", "value" => array(__("None", "wpex") => "", __("Nofollow", "wpex") => "nofollow"), "dependency" => array('element' => "url", 'not_empty' => true)))));
Esempio n. 5
0
            $add_style[] = 'font-size:' . $font_size . ';';
        }
        if ($font_color) {
            $add_style[] = 'color: ' . $font_color . ';';
        }
        $add_style = implode('', $add_style);
        if ($add_style) {
            $add_style = wp_kses($add_style, array());
            $add_style = ' style="' . esc_attr($add_style) . '"';
        }
        // Icon margin right
        if ($margin_right) {
            $margin_right = 'margin-right:' . intval($margin_right) . 'px;';
        }
        // CSS animations
        $css_animation_classes = '';
        if ($css_animation !== '') {
            $css_animation_classes = 'wpb_animate_when_almost_visible wpb_' . $css_animation . '';
        }
        // Output
        $output = '<div class="vcex-list_item ' . $css_animation_classes . ' ' . $text_align . '" ' . $add_style . '>';
        $output .= '<span class="fa fa-' . $icon . '" style="color:' . $color . ';' . $margin_right . '"></span>';
        $output .= do_shortcode($content);
        $output .= '</div>';
        return $output;
    }
}
add_shortcode('vcex_list_item', 'vcex_list_item_shortcode');
// Add To Visual Composer -------------------------------------------------------------------------- >
vc_map(array("name" => __("List Item", 'vcex'), "base" => "vcex_list_item", "class" => "", "category" => __("Lists", "wpex"), 'admin_enqueue_js' => "", 'admin_enqueue_css' => "", "icon" => "icon-wpb-vcex-list_item", "params" => array(array("type" => "dropdown", "class" => "", "heading" => __("Icon", 'vcex'), "param_name" => "icon", "admin_label" => true, "description" => sprintf(__('Select a FontAwesome icon. See all the icons at %s', 'vcex'), '<a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">FontAwesome</a>'), "value" => vcex_font_icons_array()), array("type" => "dropdown", "heading" => __("CSS Animation", "wpex"), "param_name" => "css_animation", "value" => array(__("No", "wpex") => '', __("Top to bottom", "wpex") => "top-to-bottom", __("Bottom to top", "wpex") => "bottom-to-top", __("Left to right", "wpex") => "left-to-right", __("Right to left", "wpex") => "right-to-left", __("Appear from center", "wpex") => "appear"), "description" => __("Select animation type if you want this element to be animated when it enters into the browsers viewport. Note: Works only in modern browsers.", "wpex"), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "colorpicker", "class" => "", "heading" => __("Icon Color", 'vcex'), "param_name" => "color", "value" => "#7dbd21", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Icon Right Margin", 'vcex'), "param_name" => "margin_right", "value" => "", "description" => __("Enter a custom right side margin for your icon. Example: 10px", 'vcex'), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "colorpicker", "class" => "", "heading" => __("Font Color", 'vcex'), "param_name" => "font_color", "value" => "", "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Custom Font Size", 'vcex'), "param_name" => "font_size", "value" => "", "description" => __("Enter a custom font size in pixels, such as 18px (optional). This will alter the icon and text size.", 'vcex'), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "dropdown", "class" => "", "heading" => __("Text Align", 'vcex'), "param_name" => "text_align", "value" => array(__('Left', 'vcex') => 'textleft', __('Center', 'vcex') => 'textcenter', __('Right', 'vcex') => 'textright'), "description" => __("Select your preferred text alignment.", 'vcex'), "dependency" => array('element' => "icon", 'not_empty' => true)), array("type" => "textfield", "class" => "", "heading" => __("Content", 'vcex'), "param_name" => "content", "value" => __('This is a pretty list item', 'vcex'), "description" => __("Insert your unordered list here.", 'vcex'), "dependency" => array('element' => "icon", 'not_empty' => true)))));