PATH:
home
/
nappmpmd
/
mamza.xyz
/
wp-content
/
plugins
/
adfoxly
/
vendor
/
timber
/
timber
/
lib
<?php namespace Timber; use Timber\Helper; use Timber\Post; use Timber\PostGetter; /** * A PostQuery allows a user to query for a Collection of WordPress Posts. * PostCollections are used directly in Twig templates to iterate through and retrieve * meta information about the collection of posts * @api * @package Timber */ class PostQuery extends PostCollection { /** * Found posts. * * The total amount of posts found for this query. Will be `0` if you used `no_found_rows` as a * query parameter. Will be `null` if you passed in an existing collection of posts. * * @api * @since 1.11.1 * @var int The amount of posts found in the query. */ public $found_posts = null; protected $userQuery; protected $queryIterator; protected $pagination = null; /** * @param mixed $query * @param string $post_class */ public function __construct( $query = false, $post_class = '\Timber\Post' ) { $this->userQuery = $query; $this->queryIterator = PostGetter::query_posts($query, $post_class); if ( $this->queryIterator instanceof QueryIterator ) { $this->found_posts = $this->queryIterator->found_posts(); } $posts = $this->queryIterator->get_posts(); parent::__construct($posts, $post_class); } /** * @return mixed the query the user orignally passed * to the pagination object */ protected function get_query() { return $this->userQuery; } /** * Set pagination for the collection. Optionally could be used to get pagination with custom preferences. * * @param array $prefs * @return Timber\Pagination object */ public function pagination( $prefs = array() ) { if ( !$this->pagination && is_a($this->queryIterator, 'Timber\QueryIterator') ) { $this->pagination = $this->queryIterator->get_pagination($prefs, $this->get_query()); } return $this->pagination; } }
[-] PostGetter.php
[edit]
[-] PostPreview.php
[edit]
[-] URLHelper.php
[edit]
[-] Theme.php
[edit]
[-] Term.php
[edit]
[-] Loader.php
[edit]
[-] MenuItem.php
[edit]
[+]
..
[-] ImageHelper.php
[edit]
[-] User.php
[edit]
[-] Archives.php
[edit]
[-] CoreInterface.php
[edit]
[+]
Integrations
[-] CommentThread.php
[edit]
[-] Integrations.php
[edit]
[-] Menu.php
[edit]
[-] Pagination.php
[edit]
[-] Twig_Filter.php
[edit]
[-] Image.php
[edit]
[-] TermGetter.php
[edit]
[-] Twig_Function.php
[edit]
[+]
Image
[-] PathHelper.php
[edit]
[-] PostsIterator.php
[edit]
[-] PostQuery.php
[edit]
[-] Twig.php
[edit]
[-] Admin.php
[edit]
[-] Post.php
[edit]
[+]
Cache
[-] Comment.php
[edit]
[-] Helper.php
[edit]
[-] PostType.php
[edit]
[-] Timber.php
[edit]
[-] TextHelper.php
[edit]
[-] Request.php
[edit]
[-] Site.php
[edit]
[-] PostCollection.php
[edit]
[-] QueryIterator.php
[edit]
[-] FunctionWrapper.php
[edit]
[-] LocationManager.php
[edit]
[-] Core.php
[edit]