Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
PUM_Abstract_Repository_Posts::get_items( array $args = array() )
Description Description
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Warning: foreach() argument must be of type array|object, string given in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 813
Warning: Array to string conversion in /mnt/data/home/502433.cloudwaysapps.com/rhbymdevka/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 808
Parameters Parameters
- $args
-
(Optional)
Default value: array()
Return Return
(WP_Post[]|PUM_Abstract_Model_Post[])
Source Source
File: classes/Abstract/Repository/Posts.php
public function get_items( $args = array() ) { /** Reset default strict query args. */ $this->reset_strict_query_args(); $args = $this->_build_wp_query_args( $args ); $hash = $this->get_args_hash( $args ); if ( ! isset( $this->cache['queries'][ $hash ] ) ) { /** * Initialize a new query and return it. * * This also keeps the query cached for potential later usage via $this->get_last_query(); */ $this->query->query( $args ); $this->cache['queries'][ $hash ] = (array) $this->query->posts; } /** @var array $posts */ $posts = $this->cache['queries'][ $hash ]; /** * Only convert to models if the model set is valid and not the WP_Post default. */ foreach ( $posts as $key => $post ) { $posts[ $key ] = $this->get_model( $post ); } return $posts; }
Expand full source code Collapse full source code View on Trac