Tribe__Repository::count()

{@inheritdoc}


Source

File: src/Tribe/Repository.php

	public function count() {
		if ( $this->void_query ) {
			return 0;
		}

		$query = $this->build_query();
		$query->set( 'fields', 'ids' );

		/**
		 * Filters the query object by reference before counting found posts in the current page.
		 *
		 * @since 4.7.19
		 *
		 * @param WP_Query $query
		 */
		do_action_ref_array( "{$this->filter_name}_pre_count_posts", array( &$query ) );

		$ids = $query->get_posts();

		return is_array( $ids ) ? count( $ids ) : 0;
	}