$block_classes[] = 'tmb-' . $general_style; $block_classes[] = 'tmb-overlay-anim'; $block_classes[] = 'tmb-overlay-text-anim'; $block_classes[] = 'tmb-reveal-bottom'; $block_classes[] = 'tmb-shadowed'; $block_classes[] = 'tmb-bordered'; $block_classes[] = 'tmb-iso-w' . $single_post_width; $block_classes[] = implode(' ', get_post_class()); $media_items = array(); $block_data = array(); $tmb_data = array(); $title_classes = array(); $layout = array(); $title_classes[] = 'h3'; global $uncode_index_map; $uncode_index_instance = new uncode_index($uncode_index_map); $post_category = $uncode_index_instance->getCategoriesCss($post->ID); $block_data['single_categories_id'] = $post_category['cat_id']; $block_data['single_categories'] = $uncode_index_instance->getCategoriesLink($post->ID); $block_data['classes'] = $block_classes; $block_data['tmb_data'] = $tmb_data; $block_data['id'] = $post->ID; $block_data['media_id'] = $item_thumb_id; $block_data['single_title'] = $post->post_title; $block_data['single_width'] = $single_post_width; $block_data['single_back_color'] = $general_style; $block_data['single_icon'] = 'fa fa-plus2'; $block_data['single_text'] = 'under'; $block_data['text_padding'] = 'single-block-padding'; $block_data['single_style'] = $general_style; $block_data['overlay_color'] = $overlay_back_color;
function uncode_index_get_query() { $loop = vc_post_param('content'); $allItems = vc_post_param('allItems'); $template_single = vc_post_param('templateSingle'); $template_post = vc_post_param('templatePost'); $template_portfolio = vc_post_param('templatePortfolio'); $template_page = vc_post_param('templatePage'); $template_product = vc_post_param('templateProduct'); $exclude_current = vc_post_param('postid'); if (empty($loop)) { return; } require_once vc_path_dir('PARAMS_DIR', 'loop/loop.php'); add_filter('pre_get_posts', 'uncode_hide_posts_not_published'); if ($allItems === 'true') { add_filter('pre_get_posts', 'uncode_all_posts'); } global $uncode_index_map; $u_index = new uncode_index($uncode_index_map); list($args, $my_query) = $u_index->vc_build_loop_query($loop, get_the_ID()); if (vc_post_param('custom_order') === 'true') { if (vc_post_param('order_ids') !== '') { $ordered = array(); $post_list = explode(',', vc_post_param('order_ids')); foreach ($post_list as $key) { foreach ($my_query->posts as $skey => $spost) { if ($key == $spost->ID) { $ordered[] = $spost; unset($my_query->posts[$skey]); } } } $my_query->posts = array_merge($my_query->posts, $ordered); } } $html = ''; while ($my_query->have_posts()) { $my_query->the_post(); // Get post from query $post = new stdClass(); // Creating post object. $post->id = get_the_ID(); $post->link = get_permalink($post->id); $post->type = get_post_type($post->id); $template_cat = ''; switch ($post->type) { case 'post': $template_cat = $template_post; break; case 'portfolio': $template_cat = $template_portfolio; break; case 'page': $template_cat = $template_page; break; case 'product': $template_cat = $template_product; break; } $html .= '<li class="list-list-item" data-id="' . $post->id . '"> <div class="option-tree-setting"> <div class="open"><span class="post-title">' . get_the_title() . '</span> <span class="grey">' . $post->type . '</span><span class="grey size">width: <span class="single_width_factor"></span>, height: <span class="single_height_factor"></span></span></div> <div class="button-section"> <a href="javascript:void(0);" class="option-tree-setting-edit option-tree-ui-button button left-item" title="Edit"> <span class="icon fa fa-pencil3"></span>Edit </a> <a href="javascript:void(0);" class="option-tree-setting-reset option-tree-ui-button button left-item hidden" title="Reset"> <span class="icon fa fa-reload"></span> </a> </div> <div class="option-tree-setting-body">' . $template_single . $template_cat . '</div> </div> </li>'; } $html = str_replace('\\"', '"', $html); echo do_shortcode(shortcode_unautop($html)); die; }