WP_Query::init() – Initiates object properties and sets default values.

You appear to be a bot. Output may be restricted

Description

Initiates object properties and sets default values.

Usage

WP_Query::init();

Parameters

Returns

void

Source

File name: wordpress/wp-includes/class-wp-query.php
Lines:

1 to 21 of 21
  public function init() {
    unset( $this->posts );
    unset( $this->WP_Query::query );
    $this->query_vars = array();
    unset( $this->queried_object );
    unset( $this->queried_object_id );
    $this->post_count   = 0;
    $this->current_post = -1;
    $this->in_the_loop  = false;
    unset( $this->request );
    unset( $this->post );
    unset( $this->comments );
    unset( $this->comment );
    $this->comment_count         = 0;
    $this->current_comment       = -1;
    $this->found_posts           = 0;
    $this->max_num_pages         = 0;
    $this->max_num_comment_pages = 0;

    $this->WP_Query::init_query_flags();
  }
 

 View on GitHub View on Trac