function reg_quick_ajax() { if (function_exists('wpb_map')) { $sizes = waq_list_thumbnail_sizes(); $thumbnail_array = array(); foreach ($sizes as $size => $atts) { $thumbnail_array[$size . ' ' . implode('x', $atts)] = $size; } $cats = get_terms('category', 'hide_empty=0'); $cat_array = array(); if ($cats) { foreach ($cats as $acat) { $cat_array[$acat->name] = $acat->term_id; } } vc_map(array("name" => __("Quick Ajax", "leafcolor"), "base" => "wpajax", "content_element" => true, "show_settings_on_create" => true, "icon" => "quick-ajax-icon", "params" => array(array("type" => "dropdown", "holder" => "div", "heading" => __("Layout", "leafcolor"), "param_name" => "layout", "value" => array(__("Classic", "leafcolor") => 'classic', __("Timeline", "leafcolor") => 'timeline', __("Modern", "leafcolor") => 'modern', __("Combo", "leafcolor") => 'combo'), "description" => ""), array("type" => "textfield", "heading" => __("Column width", "leafcolor"), "param_name" => "col_width", "value" => "", "description" => __('Only number for px(Ex: 225) Uses for column width in Modern layout and Thumbnail width in Classic layout', "leafcolor")), array("type" => "dropdown", "holder" => "div", "heading" => __("Ajax style", "leafcolor"), "param_name" => "ajax_style", "value" => array(__("Next Button", "leafcolor") => 'button', __("Infinity Scroll", "leafcolor") => 'scroll'), "description" => ""), array("type" => "dropdown", "holder" => "div", "heading" => __("Thumbnail Size", "leafcolor"), "param_name" => "thumb_size", "value" => $thumbnail_array, "description" => ""), array("type" => "checkbox", "heading" => __("Choose category", "leafcolor"), "param_name" => "cat", "value" => $cat_array, "description" => __("Select Categories", "leafcolor")), array("type" => "textfield", "heading" => __("Tags", "leafcolor"), "param_name" => "tag", "value" => "", "description" => __('Ex: foo,bar,sample-tag (Uses tag slug)', "leafcolor")), array("type" => "posttypes", "heading" => __("Post Type", "leafcolor"), "param_name" => "post_type", "value" => "", "description" => ""), array("type" => "textfield", "heading" => __("Posts per page", "leafcolor"), "param_name" => "posts_per_page", "value" => "", "description" => __("Number of posts per page", "leafcolor"))))); } }
function waq_thumb_size_html() { global $waq_options; $waq_thumb_size = isset($waq_options['thumb_size']) ? $waq_options['thumb_size'] : 'thumbnail'; ?> <select name="waq_options_group[thumb_size]"> <?php $sizes = waq_list_thumbnail_sizes(); foreach ($sizes as $size => $atts) { ?> <option value="<?php echo $size; ?> " <?php echo $waq_thumb_size == $size ? 'selected' : ''; ?> ><?php echo $size . ' ' . implode('x', $atts); ?> </option> <?php } ?> </select> <?php }