PHP Class Timber\QueryIterator

Inheritance: implements Iterator, implements Countable
Show file Open project: jarednova/timber

Public Methods

Method Description
__construct ( $query = false, $posts_class = 'Timber\Post' )
count ( ) : integer Count elements of an object.
current ( )
fix_cat_wp_quirk ( $query ) get_posts uses category, WP_Query uses cat. Why? who knows.
fix_number_posts_wp_quirk ( $query ) get_posts users numberposts
get_pagination ( $prefs )
get_posts ( $return_collection = false )
get_query_from_array_of_ids ( $query = [] )
get_query_from_string ( $string = '' )
handle_maybe_custom_posts_page ( WP_Query $query ) : WP_Query this will test for whether a custom page to display posts is active, and if so, set the query to the default
key ( )
next ( ) Don't implement next, because current already advances the loop
post_count ( )
rewind ( )
valid ( )

Method Details

__construct() public method

public __construct ( $query = false, $posts_class = 'Timber\Post' )

count() public method

Necessary for some Twig loop variable properties.
See also: http://twig.sensiolabs.org/doc/tags/for.html#the-loop-variable
public count ( ) : integer
return integer The custom count as an integer. The return value is cast to an integer.

current() public method

public current ( )

fix_cat_wp_quirk() public static method

..
public static fix_cat_wp_quirk ( $query )

fix_number_posts_wp_quirk() public static method

get_posts users numberposts
public static fix_number_posts_wp_quirk ( $query )

get_pagination() public method

public get_pagination ( $prefs )

get_posts() public method

public get_posts ( $return_collection = false )

get_query_from_array_of_ids() public static method

public static get_query_from_array_of_ids ( $query = [] )

get_query_from_string() public static method

public static get_query_from_string ( $string = '' )

handle_maybe_custom_posts_page() public static method

this will test for whether a custom page to display posts is active, and if so, set the query to the default
public static handle_maybe_custom_posts_page ( WP_Query $query ) : WP_Query
$query WP_Query the original query recived from WordPress
return WP_Query

key() public method

public key ( )

next() final public method

Don't implement next, because current already advances the loop
final public next ( )

post_count() public method

public post_count ( )

rewind() public method

public rewind ( )

valid() public method

public valid ( )