Exemple #1
0
 public function __construct(Context $context, $template = null)
 {
     parent::__construct($context, $template);
     global $wp_query;
     if ($wp_query->post) {
         $this->post = $context->modelForPost($wp_query->post);
     }
 }
Exemple #2
0
 public function __construct(Context $context, $template = null)
 {
     parent::__construct($context, $template);
     global $wp_query;
     if ($wp_query->post) {
         $post = $context->modelForPost($wp_query->post);
         if ($post instanceof Page) {
             $this->page = $post;
             $context->cacheControl->setCacheControlHeadersForPage($this->page->id);
         }
     }
 }
Exemple #3
0
 public function __construct(Context $context, $template = null)
 {
     parent::__construct($context, $template);
     global $wp_query;
     if ($wp_query->post && $wp_query->post->post_type == 'page') {
         $this->page = $context->modelForPost($wp_query->post);
         $context->cacheControl->setCacheControlHeadersForPage($this->page->id);
     }
     $this->totalPosts = $wp_query->found_posts;
     $this->currentPage = $wp_query->query_vars['paged'] ?: 1;
     foreach ($wp_query->posts as $post) {
         $this->posts[] = $this->context->modelForPost($post);
     }
 }
Exemple #4
0
 public function __construct(Context $context, $template = null)
 {
     parent::__construct($context, $template);
 }