Exemplo n.º 1
0
/**
 * Return an array of heading levels for use in a Visual Composer dropdown param.
 *
 * @since   1.0.0
 *
 * @param   string  $context  The context to pass to our filter.
 *
 * @return  array             The array of heading levels.
 */
function mm_get_wrapper_elements_for_vc($context = '')
{
    $empty_option = array(__('Select an element', 'mm-components'));
    return $empty_option + array_flip(mm_get_wrapper_elements($context));
}
Exemplo n.º 2
0
/**
 * Register UI for Shortcake.
 *
 * @since  1.0.0
 */
function mm_components_mm_custom_content_shortcode_ui()
{
    if (!function_exists('shortcode_ui_register_for_shortcode')) {
        return;
    }
    $elements = mm_get_wrapper_elements('mm-custom-content');
    $fonts = mm_get_fonts('mm-custom-content');
    $font_weights = mm_get_font_weights('mm-custom-content');
    $colors = mm_get_colors('mm-custom-content');
    $text_alignments = mm_get_text_alignment('mm-custom-content');
    $link_targets = mm_get_link_targets('mm-custom-content');
    shortcode_ui_register_for_shortcode('mm_custom_content', array('label' => esc_html__('Mm Custom Content', 'mm-components'), 'listItemImage' => MM_COMPONENTS_ASSETS_URL . 'component-icon.png', 'attrs' => array(array('label' => esc_html__('Content', 'mm-components'), 'attr' => 'content_text', 'type' => 'textarea'), array('label' => esc_html__('Wrapper Element', 'mm-components'), 'attr' => 'element', 'type' => 'select', 'options' => $elements), array('label' => esc_html__('Font', 'mm-components'), 'attr' => 'font_family', 'type' => 'select', 'options' => $fonts), array('label' => esc_html__('Font Size', 'mm-components'), 'description' => esc_html__('Leave blank to use default size, or specify a number of pixels. Example: 16', 'mm-components'), 'attr' => 'size', 'type' => 'text'), array('label' => esc_html__('Font Weight', 'mm-components'), 'attr' => 'weight', 'type' => 'select', 'options' => $font_weights), array('label' => esc_html__('Text Transform', 'mm-components'), 'attr' => 'text_transform', 'type' => 'select', 'options' => array('' => esc_html__('None', 'mm-components '), 'uppercase' => esc_html__('Uppercase', 'mm-components '))), array('label' => esc_html__('Text Align', 'mm-components'), 'attr' => 'alignment', 'type' => 'select', 'options' => $text_alignments), array('heading' => esc_html__('Color', 'mm-components'), 'attr' => 'color', 'type' => 'select', 'options' => $colors), array('label' => esc_html__('Margin Bottom', 'mm-components'), 'description' => esc_html__('Leave blank to use default margin, or specify a number of pixels. Example: 16', 'mm-components'), 'attr' => 'margin_bottom', 'type' => 'text'))));
}