function form($instance) { $defaults = array('text' => '', 'icon' => '', 'icon_size' => 'large', 'location' => 'top', 'wpautop' => 0, 'lead' => 0, 'vertical' => 0, 'subtitle' => '', 'type' => 'top'); $icon_options = web_get_icons(); $display_types = array('top' => 'Icon on Top', 'left' => 'Icon on Left'); $size_types = array('large' => 'Large', 'small' => 'Small'); $instance = wp_parse_args($instance, $defaults); extract($instance); ?> <p class="description">Title <code>Optional</code></p> <?php echo aq_field_input('title', $block_id, $title, $size = 'full'); ?> <p class="description">Subtitle <code>Optional</code></p> <?php echo aq_field_input('subtitle', $block_id, $subtitle, $size = 'full'); ?> <p class="description">Block Content</p> <?php echo aq_field_editor('text', $block_id, $text); ?> <hr /> <div class="description cf"> <div class="icon-modal"> <div class="icon-modal-inner cf"> <div class="icon-modal-title"> <a href="#" class="icon-modal-closer"><i class="fa fa-times"></i></a> <h3>Choose an Icon</h3> <div class="cf"></div> </div> <div class="ebor-modal-content"> <?php foreach ($icon_options as $key) { $class = $key == $icon ? 'active' : ''; echo '<div class="ebor-modal-icon ' . $class . '" data-ebor-icon="' . $key . '"><i class="icon ' . $key . '"></i></div>'; } ?> </div> </div> </div> <p class="description">Icon <code>Leave Blank for No Icon</code></p> <a href="#" class="ebor-icon-modal-launcher button button-primary one_third text-center">Choose Icon</a> <div class="two_thirds last"> <?php echo aq_field_input('icon', $block_id, $icon, $size = 'full'); ?> </div> </div> <hr /> <div class="one_half"> <p class="description">Icon Location</p> <?php echo aq_field_select('type', $block_id, $display_types, $type); ?> </div> <div class="one_half last"> <p class="description">Icon Size</p> <?php echo aq_field_select('icon_size', $block_id, $size_types, $icon_size); ?> </div> <div class="cf"></div> <hr /> <div class="ebor-checkbox cf"> <?php echo aq_field_checkbox('wpautop', $block_id, $wpautop); ?> <p class="description">Disable Auto Paragraphs? <code>wpautop</code></p> </div> <div class="ebor-checkbox cf"> <?php echo aq_field_checkbox('lead', $block_id, $lead); ?> <p class="description">Use Larger Font Size? <code>For Intros etc.</code></p> </div> <div class="ebor-checkbox cf"> <?php echo aq_field_checkbox('vertical', $block_id, $vertical); ?> <p class="description">Vertically Align Text Within Row? <code>Use Sparingly!</code></p> </div> <?php }
/** * The VC Functions */ function web_text_shortcode_vc() { vc_map(array("icon" => 'web-vc-block', "name" => __("Web - Text"), "base" => "web_text", "category" => __('Web', 'web'), "params" => array(array("type" => "textfield", "heading" => __("Title", 'web'), "param_name" => "title", "value" => ''), array("type" => "textfield", "heading" => __("Subtitle", 'web'), "param_name" => "subtitle", "value" => ''), array("type" => "textarea_html", "heading" => __("Content", 'web'), "param_name" => "content", "value" => '', 'holder' => 'div'), array("type" => "dropdown", "heading" => __("Show an Icon?", 'web'), "param_name" => "icon", "value" => array_values(web_get_icons())), array("type" => "dropdown", "heading" => __("Icon Location", 'web'), "param_name" => "type", "value" => array_flip(array('top' => 'Icon on Top', 'left' => 'Icon on Left'))), array("type" => "dropdown", "heading" => __("Icon Size", 'web'), "param_name" => "icon_size", "value" => array_flip(array('large' => 'Large', 'small' => 'Small'))), array("type" => "dropdown", "heading" => __("Use Large Font Size?", 'web'), "param_name" => "lead", "value" => array_flip(array('no' => 'No', 'yes' => 'Yes')))))); }