function frontend_render_cell_content($target)
 {
     global $WPV_templates;
     $content = '';
     $cell_content = $this->get_content();
     if ($cell_content['page'] == 'current_page') {
         do_action('ddl-layouts-render-start-post-content');
     }
     if (isset($WPV_templates) && isset($cell_content['ddl_view_template_id']) && $cell_content['ddl_view_template_id'] != 'None') {
         $content_template_id = $cell_content['ddl_view_template_id'];
         if ($cell_content['page'] == 'current_page') {
             global $post;
             $content = render_view_template($content_template_id, $post);
         } elseif ($cell_content['page'] == 'this_page') {
             $get_post_query = new WP_Query(array('p' => $cell_content['selected_post'], 'post_type' => 'any'));
             while ($get_post_query->have_posts()) {
                 $get_post_query->the_post();
                 $content = render_view_template($content_template_id);
             }
             wp_reset_postdata();
         }
         $content = do_shortcode(apply_filters('ddl-content-template-cell-do_shortcode', $content, $this));
     } else {
         $content = WPDDL_Messages::views_missing_message();
     }
     $target->cell_content_callback($content, $this);
     if ($cell_content['page'] == 'current_page') {
         do_action('ddl-layouts-render-end-post-content');
     }
 }
 function frontend_render_cell_content($target)
 {
     global $ddl_fields_api;
     $ddl_fields_api->set_current_cell_content($this->get_content());
     if (function_exists('render_view')) {
         global $WPV_view_archive_loop, $wp_query;
         $WPV_view_archive_loop->query = clone $wp_query;
         $WPV_view_archive_loop->in_the_loop = true;
         $target->cell_content_callback(render_view(array('id' => get_ddl_field('ddl_layout_view_id'))), $this);
         $WPV_view_archive_loop->in_the_loop = false;
     } else {
         $target->cell_content_callback(WPDDL_Messages::views_missing_message(), $this);
     }
 }
 function views_content_grid_content_callback()
 {
     //Render View
     if (function_exists('render_view')) {
         $mode = get_ddl_field('parametric_mode');
         $target = get_ddl_field('parametric_mode_target');
         $target_id = get_ddl_field('parametric_target_id');
         if ($target == 'self') {
             $target_id = 'self';
         }
         if ($mode == 'form' && !empty($target_id)) {
             return render_view(array('id' => get_ddl_field('ddl_layout_view_id'), 'target_id' => $target_id));
         } else {
             if ($mode == 'results') {
                 return render_view(array('id' => get_ddl_field('ddl_layout_view_id'), 'view_display' => 'layout'));
             } else {
                 return render_view(array('id' => get_ddl_field('ddl_layout_view_id')));
             }
         }
     } else {
         return WPDDL_Messages::views_missing_message();
     }
 }