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::count_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()


Top ↑

Return Return

(int)


Top ↑

Source Source

File: classes/Abstract/Repository/Posts.php

	public function count_items( $args = array() ) {
		/** Reset default strict query args. */
		$this->reset_strict_query_args();

		/** Set several strict query arg overrides, no matter what args were passed. */
		$this->set_strict_query_arg( 'fields', 'ids' );
		$this->set_strict_query_arg( 'posts_per_page', 1 );

		/** We don't use  $this->query here to avoid returning count queries via $this->>get_last_query(); */
		$query = new WP_Query( $this->_build_wp_query_args( $args ) );

		return (int) $query->found_posts;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.