Esempio n. 1
0
/**
 * Return an array of Mm Social Icons types.
 *
 * @since   1.0.0
 *
 * @param   string  $context  The context to pass to our filter.
 *
 * @return  array             The array of type names.
 */
function mm_get_social_icons_types($context = '')
{
    return array_flip(mm_get_social_icons_types_for_vc($context));
}
Esempio n. 2
0
/**
 * Visual Composer add-on.
 *
 * @since  1.0.0
 */
function mm_vc_social_icons()
{
    $social_icons_types = mm_get_social_icons_types_for_vc('mm-social-icons');
    $icon_styles = mm_get_icon_styles_for_vc('mm-social-icons');
    $image_sizes = mm_get_image_sizes_for_vc('mm-social-icons');
    $text_alignment = mm_get_text_alignment_for_vc('mm-social-icons');
    $colors = mm_get_colors_for_vc('mm-social-icons');
    $social_networks = mm_get_social_networks_for_vc('mm-social-icons');
    // Add our brand colors option.
    $brand_colors = array(__('Brand Colors', 'mm-components') => 'brand-colors');
    $colors = array_merge($colors, $brand_colors);
    vc_map(array('name' => __('Social Icons', 'mm-components'), 'base' => 'mm_social_icons', 'icon' => MM_COMPONENTS_ASSETS_URL . 'component-icon.png', 'category' => __('Content', 'mm-components'), 'params' => array(array('type' => 'dropdown', 'heading' => __('Icon Type', 'mm-components'), 'param_name' => 'icon_type', 'value' => $social_icons_types), array('type' => 'dropdown', 'heading' => __('Image Size', 'mm-components'), 'param_name' => 'image_size', 'value' => $image_sizes, 'dependency' => array('element' => 'icon_type', 'value' => 'images')), array('type' => 'dropdown', 'heading' => __('Icon Alignment', 'mm-components'), 'param_name' => 'alignment', 'value' => $text_alignment), array('type' => 'dropdown', 'heading' => __('Icon Style', 'mm-components'), 'param_name' => 'style', 'value' => $icon_styles, 'dependency' => array('element' => 'icon_type', 'value' => 'fontawesome')), array('type' => 'checkbox', 'heading' => __('Ghost Mode?', 'mm-components'), 'param_name' => 'ghost', 'description' => __('Colored icon and icon border with a transparent background', 'mm-components'), 'value' => array(__('Yes') => 1), 'dependency' => array('element' => 'style', 'value' => array('circle', 'square', 'rounded-square'))), array('type' => 'dropdown', 'heading' => __('Icon Color', 'mm-components'), 'param_name' => 'color', 'value' => $colors, 'dependency' => array('element' => 'icon_type', 'value' => 'fontawesome')), array('type' => 'dropdown', 'heading' => __('Icon Size', 'mm-components'), 'param_name' => 'size', 'value' => array(__('Normal', 'mm-components') => '', __('Small', 'mm-components') => 'small', __('Large', 'mm-components') => 'large')))));
    $social_network_params = array();
    foreach ($social_networks as $social_network_label => $social_network) {
        $social_network_params[] = array('type' => 'textfield', 'heading' => $social_network_label . ' ' . __('Link', 'mm-components'), 'param_name' => $social_network . '_link', 'value' => '');
        $social_network_params[] = array('type' => 'attach_image', 'heading' => $social_network_label . ' ' . __('Image', 'mm-components'), 'param_name' => $social_network . '_image', 'dependency' => array('element' => 'icon_type', 'value' => 'images'));
    }
    vc_add_params('mm_social_icons', $social_network_params);
}