WordPress at a glance
function is not described

WP::main() public WP 2.0.0

Sets up all of the variables required by the WordPress environment.

The action 'wp' has one parameter that references the WP object. It allows for accessing the properties and methods to further manipulate the object.

{} It's a method of the class: WP{}

Hooks from the method
Return

````. Null. Nothing.

Usage

global $wp;
$wp->main( $query_args );
$query_args(string|array)
Passed to parse_request().

Changelog

Since 2.0.0 Introduced.

Code of WP::main() WP 5.7

<?php
public function main( $query_args = '' ) {
	$this->init();
	$this->parse_request( $query_args );
	$this->send_headers();
	$this->query_posts();
	$this->handle_404();
	$this->register_globals();

	/**
	 * Fires once the WordPress environment has been set up.
	 *
	 * @since 2.1.0
	 *
	 * @param WP $this Current WordPress environment instance (passed by reference).
	 */
	do_action_ref_array( 'wp', array( &$this ) );
}