WP_CLI\Iterators
Query::valid
Method of the class: Query{}
No Hooks.
Returns
null. Nothing (null).
Usage
$Query = new Query(); $Query->valid();
Query::valid() Query::valid code WP-CLI 2.13.0-alpha
public function valid() {
if ( $this->depleted ) {
return false;
}
if ( ! isset( $this->results[ $this->index_in_results ] ) ) {
$items_loaded = $this->load_items_from_db();
if ( ! $items_loaded ) {
$this->rewind();
$this->depleted = true;
return false;
}
$this->index_in_results = 0;
}
return true;
}