WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Купить персональные IPV4 и IPV6 прокси
функция не описана

WP_Query::have_posts() WP 1.5.0

Determines whether there are more posts available in the loop.

Calls the 'loop_end' action when the loop is complete.

Это метод класса: WP_Query

Хуки из метода
Возвращает

true/false. True if posts are available, false if end of loop.

Использование

$WP_Query = new WP_Query();
$var = $WP_Query->have_posts();

Список изменений

С версии 1.5.0 Введена.

Код WP Query::have posts: wp-includes/class-wp-query.php WP 5.2.2

<?php
public function have_posts() {
	if ( $this->current_post + 1 < $this->post_count ) {
		return true;
	} elseif ( $this->current_post + 1 == $this->post_count && $this->post_count > 0 ) {
		/**
		 * Fires once the loop has ended.
		 *
		 * @since 2.0.0
		 *
		 * @param WP_Query $this The WP_Query instance (passed by reference).
		 */
		do_action_ref_array( 'loop_end', array( &$this ) );
		// Do some cleaning up after the loop
		$this->rewind_posts();
	} elseif ( 0 === $this->post_count ) {
		/**
		 * Fires if no results are found in a post query.
		 *
		 * @since 4.9.0
		 *
		 * @param WP_Query $this The WP_Query instance.
		 */
		do_action( 'loop_no_results', $this );
	}

	$this->in_the_loop = false;
	return false;
}