Example #1
0
/**
 * Visual Composer add-on.
 *
 * @since  1.0.0
 */
function mm_vc_image_card()
{
    $text_alignments = mm_get_text_alignment_for_vc('mm-image-card');
    $image_card_styles = mm_get_image_card_styles_for_vc('mm-image-card');
    $image_sizes = mm_get_image_sizes_for_vc('mm-image-card');
    $image_text_colors = mm_get_colors_for_vc('mm-image-card');
    $button_styles = mm_get_button_styles_for_vc('mm-button');
    $button_border_weights = mm_get_button_border_weights_for_vc('mm-button');
    $button_corner_styles = mm_get_button_corner_styles_for_vc('mm-button');
    $button_colors = mm_get_colors_for_vc('mm-button');
    vc_map(array('name' => __('Image Card', 'mm-components'), 'base' => 'mm_image_card', 'icon' => MM_COMPONENTS_ASSETS_URL . 'component-icon.png', 'category' => __('Content', 'mm-components'), 'params' => array(array('type' => 'attach_image', 'heading' => __('Image Card Image', 'mm-components'), 'param_name' => 'image'), array('type' => 'dropdown', 'heading' => __('Image Card Style', 'mm-components'), 'param_name' => 'image_card_style', 'value' => $image_card_styles), array('type' => 'dropdown', 'heading' => __('Image Size', 'mm-components'), 'param_name' => 'image_size', 'value' => $image_sizes), array('type' => 'textfield', 'heading' => __('Image Text', 'mm-components'), 'param_name' => 'image_text', 'dependency' => array('element' => 'image_card_style', 'value' => 'text-inside')), array('type' => 'dropdown', 'heading' => __('Image Text Color', 'mm-components'), 'param_name' => 'image_text_color', 'value' => $image_text_colors, 'dependency' => array('element' => 'image_card_style', 'value' => 'text-inside')), array('type' => 'checkbox', 'heading' => __('Link Image?', 'mm-components'), 'param_name' => 'link_image'), array('type' => 'vc_link', 'heading' => __('Image Card URL', 'mm-components'), 'param_name' => 'link'), array('type' => 'dropdown', 'heading' => __('Content Alignment', 'mm-components'), 'param_name' => 'content_align', 'value' => $text_alignments), array('type' => 'textfield', 'heading' => __('Button Text', 'mm-components'), 'param_name' => 'button_text', 'dependency' => array('element' => 'image_card_style', 'value' => 'button-bottom')), array('type' => 'dropdown', 'heading' => __('Button Style', 'mm-components'), 'param_name' => 'button_style', 'value' => $button_styles, 'dependency' => array('element' => 'image_card_style', 'value' => 'button-bottom')), array('type' => 'dropdown', 'heading' => __('Button Border Weight', 'mm-components'), 'param_name' => 'button_border_weight', 'value' => $button_border_weights, 'dependency' => array('element' => 'button_style', 'value' => array('ghost', 'solid-to-ghost'))), array('type' => 'dropdown', 'heading' => __('Button Color', 'mm-components'), 'param_name' => 'button_color', 'value' => $button_colors, 'dependency' => array('element' => 'image_card_style', 'value' => 'button')))));
}
/**
 * Visual Composer add-on.
 *
 * @since  1.0.0
 */
function mm_vc_expandable_content()
{
    $button_styles = mm_get_button_styles_for_vc('mm-expandable-content');
    $button_border_weights = mm_get_button_border_weights_for_vc('mm-expandable-content');
    $button_corner_styles = mm_get_button_corner_styles_for_vc('mm-expandable-content');
    $button_colors = mm_get_colors_for_vc('mm-expandable-content');
    $alignment = mm_get_text_alignment_for_vc('mm-expandable-content');
    /**
     * Expandable Content.
     */
    vc_map(array('name' => __('Expandable Content', 'mm-components'), 'base' => 'mm_expandable_content', 'icon' => MM_COMPONENTS_ASSETS_URL . 'expandable-content-icon.png', 'as_parent' => array('except' => ''), 'is_container' => true, 'params' => array(array('type' => 'dropdown', 'heading' => __('Button or Link?', 'mm-components'), 'param_name' => 'link_style', 'description' => __('Should the trigger be a button or a link?', 'mm-components'), 'value' => array(__('Select Button or Link', 'mm-components'), __('Button', 'mm-components') => 'button', __('Link', 'mm-components') => 'link')), array('type' => 'dropdown', 'heading' => __('Button Style', 'mm-components'), 'param_name' => 'button_style', 'value' => $button_styles, 'dependency' => array('element' => 'link_style', 'value' => 'button')), array('type' => 'dropdown', 'heading' => __('Button Border Weight', 'mm-components'), 'param_name' => 'button_border_weight', 'value' => $button_border_weights, 'dependency' => array('element' => 'button_style', 'value' => array('ghost', 'solid-to-ghost'))), array('type' => 'dropdown', 'heading' => __('Button Corner Style', 'mm-components'), 'param_name' => 'button_corner_style', 'value' => $button_corner_styles, 'dependency' => array('element' => 'link_style', 'value' => 'button')), array('type' => 'dropdown', 'heading' => __('Button Color', 'mm-components'), 'param_name' => 'button_color', 'value' => $button_colors, 'dependency' => array('element' => 'link_style', 'value' => 'button')), array('type' => 'textfield', 'heading' => __('Button/Link Text', 'mm-components'), 'param_name' => 'link_text', 'description' => __('The text for the button/link', 'mm-components'), 'value' => ''), array('type' => 'dropdown', 'heading' => __('Button/Link Alignment', 'mm-components'), 'param_name' => 'link_alignment', 'value' => $alignment), array('type' => 'checkbox', 'heading' => __('Fade in?', 'mm-components'), 'param_name' => 'fade', 'value' => array(__('Yes', 'mm-components') => 'fade')), array('type' => 'textfield', 'heading' => __('Extra class name', 'mm-components'), 'param_name' => 'class', 'description' => __('Style particular content element differently - add a class name and refer to it in custom CSS.', 'mm-components'))), 'js_view' => 'VcColumnView'));
}
Example #3
0
/**
 * Visual Composer add-on.
 *
 * @since  1.0.0
 */
function mm_vc_button()
{
    $button_style = mm_get_button_styles_for_vc('mm-button');
    $button_border_weights = mm_get_button_border_weights_for_vc('mm-button');
    $button_corner_styles = mm_get_button_corner_styles_for_vc('mm-button');
    $colors = mm_get_colors_for_vc('mm-button');
    $text_alignment = mm_get_text_alignment_for_vc('mm-button');
    vc_map(array('name' => __('Button', 'mm-components'), 'base' => 'mm_button', 'class' => '', 'icon' => MM_COMPONENTS_ASSETS_URL . 'component-icon.png', 'category' => __('Content', 'mm-components'), 'params' => array(array('type' => 'vc_link', 'heading' => __('Button URL', 'mm-components'), 'param_name' => 'link', 'value' => ''), array('type' => 'dropdown', 'heading' => __('Button Style', 'mm-components'), 'param_name' => 'style', 'value' => $button_style), array('type' => 'dropdown', 'heading' => __('Border Weight', 'mm-components'), 'param_name' => 'border_weight', 'value' => $button_border_weights, 'dependency' => array('element' => 'style', 'value' => array('ghost', 'solid-to-ghost'))), array('type' => 'dropdown', 'heading' => __('Corner Style', 'mm-components'), 'param_name' => 'corner_style', 'value' => $button_corner_styles), array('type' => 'dropdown', 'heading' => __('Color', 'mm-components'), 'param_name' => 'color', 'value' => $colors), array('type' => 'dropdown', 'heading' => __('Button Size', 'mm-components'), 'param_name' => 'size', 'value' => array(__('Normal', 'mm-components') => 'normal-size', __('Small', 'mm-components') => 'small', __('Large', 'mm-components') => 'large')), array('type' => 'checkbox', 'heading' => __('Full Width Button', 'mm-components'), 'param_name' => 'full_width', 'description' => __('Choosing full-width will make the button take up the width of its container.', 'mm-components'), 'value' => array(__('Yes', 'mm-components') => 'true')), array('type' => 'dropdown', 'heading' => __('Button Alignment', 'mm-components'), 'param_name' => 'alignment', 'value' => $text_alignment), array('type' => 'textarea_html', 'heading' => __('Button Text', 'mm-components'), 'param_name' => 'content', 'admin_label' => true, 'value' => ''))));
}
Example #4
0
/**
 * Visual Composer add-on.
 *
 * @since  1.0.0
 */
function mm_vc_hero_banner()
{
    $background_positions = mm_get_background_position_for_vc('mm-hero-banner');
    $overlay_colors = mm_get_overlay_colors_for_vc('mm-hero-banner');
    $overlay_opacity_values = mm_get_overlay_opacity_values_for_vc('mm-hero-banner');
    $text_colors = mm_get_colors_for_vc('mm-hero-banner');
    $heading_levels = mm_get_heading_levels_for_vc('mm-hero-banner');
    $text_alignments = mm_get_text_alignment_for_vc('mm-hero-banner');
    $button_styles = mm_get_button_styles_for_vc('mm-button');
    $button_border_weights = mm_get_button_border_weights_for_vc('mm-button');
    $button_corner_styles = mm_get_button_corner_styles_for_vc('mm-button');
    $button_colors = mm_get_colors_for_vc('mm-button');
    vc_map(array('name' => __('Hero Banner', 'mm-components'), 'base' => 'mm_hero_banner', 'icon' => MM_COMPONENTS_ASSETS_URL . 'component-icon.png', 'category' => __('Content', 'mm-components'), 'params' => array(array('type' => 'attach_image', 'heading' => __('Background Image', 'mm-components'), 'param_name' => 'background_image'), array('type' => 'dropdown', 'heading' => __('Background Position', 'mm-components'), 'param_name' => 'background_position', 'value' => $background_positions), array('type' => 'checkbox', 'heading' => __('Full Height', 'mm-components'), 'param_name' => 'full_height', 'description' => __('Check this to make the Hero Banner as tall as the window.', 'mm-components'), 'value' => array(__('Yes', 'mm-components') => 1)), array('type' => 'textfield', 'heading' => __('Minimum Height', 'mm-components'), 'param_name' => 'min_height', 'description' => __('Specify a number of pixels. Default is 360.', 'mm-components')), array('type' => 'dropdown', 'heading' => __('Overlay Color', 'mm-components'), 'param_name' => 'overlay_color', 'value' => $overlay_colors), array('type' => 'dropdown', 'heading' => __('Overlay Opacity', 'mm-components'), 'param_name' => 'overlay_opacity', 'value' => $overlay_opacity_values, 'dependency' => array('element' => 'overlay_color', 'not_empty' => true)), array('type' => 'dropdown', 'heading' => __('Text Color', 'mm-components'), 'param_name' => 'text_color', 'value' => $text_colors), array('type' => 'textfield', 'heading' => __('Heading Text', 'mm-components'), 'param_name' => 'heading_text', 'admin_label' => true), array('type' => 'dropdown', 'heading' => __('Heading Level', 'mm-components'), 'param_name' => 'heading_level', 'value' => $heading_levels), array('type' => 'textarea_html', 'heading' => __('Content', 'mm-components'), 'param_name' => 'content'), array('type' => 'dropdown', 'heading' => __('Content Alignment', 'mm-components'), 'param_name' => 'content_align', 'value' => $text_alignments), array('type' => 'vc_link', 'heading' => __('Button URL', 'mm-components'), 'param_name' => 'button_link'), array('type' => 'textfield', 'heading' => __('Button Text', 'mm-components'), 'param_name' => 'button_text'), array('type' => 'dropdown', 'heading' => __('Button Style', 'mm-components'), 'param_name' => 'button_style', 'value' => $button_styles), array('type' => 'dropdown', 'heading' => __('Button Border Weight', 'mm-components'), 'param_name' => 'button_border_weight', 'value' => $button_border_weights, 'dependency' => array('element' => 'button_style', 'value' => array('ghost', 'solid-to-ghost'))), array('type' => 'dropdown', 'heading' => __('Button Corner Style', 'mm-components'), 'param_name' => 'button_corner_style', 'value' => $button_corner_styles), array('type' => 'dropdown', 'heading' => __('Button Color', 'mm-components'), 'param_name' => 'button_color', 'value' => $button_colors), array('type' => 'textarea_raw_html', 'heading' => __('Secondary Content', 'mm-components'), 'param_name' => 'secondary_content', 'description' => __('Outputs below the main button. Can include HTML markup.', 'mm-components')))));
}