Esempio n. 1
0
    global $post;
    //, $wp_query;
    $posts_array[$post->ID] = $post->post_type;
}
foreach ($posts_array as $id => $type) {
    $classes = 'uposts-post uposts-posts-' . $id . ' ';
    ?>
	<li <?php 
    apply_filters('upfront_posts_post_classes', post_class($classes), $post);
    ?>
 data-post_id="<?php 
    echo $id;
    ?>
">
		<?php 
    echo Upfront_ThisPostView::get_post_markup($id, $type, $properties, $layout, true);
    ?>
	</li>
<?php 
}
// Clean up after this post:
global $wp_query;
$wp_query->is_single = false;
?>
</ul>
<?php 
if ($properties['pagination']) {
    ?>
<div class="uposts-pagination upfront-pagination <?php 
    echo $properties['pagination'];
    ?>
Esempio n. 2
0
 public function load_markup_old()
 {
     $data = json_decode(stripslashes($_POST['data']), true);
     if (!is_numeric($data['post_id'])) {
         die('error');
     }
     $content = '';
     if ($data['post_id']) {
         $post = get_post($data['post_id']);
         if (!$post) {
             return $this->_out(new Upfront_JsonResponse_Error('Unknown post.'));
         }
         if ($post->post_status == 'trash') {
             $content = '<div class="ueditor_deleted_post ueditable upfront-ui">' . sprintf(Upfront_ThisPostView::_get_l10n('thrashed_post'), $post->post_type, $post->post_type) . '</div>';
         } else {
             $content = Upfront_ThisPostView::get_post_markup($data['post_id'], null, $data['properties']);
         }
     } else {
         if ($data['post_type']) {
             $content = Upfront_ThisPostView::get_new_post_contents($data['post_type'], $data['properties']);
         } else {
             $this->_out(new Upfront_JsonResponse_Error('Not enough data.'));
         }
     }
     $this->_out(new Upfront_JsonResponse_Success(array("filtered" => $content)));
 }