WP_Site_Query::parse_query() WordPress Method

The WP_Site_Query::parse_query() is a Wordpress method used to parse a query string for a site. The method returns an array of query results, which can be used to generate a WordPress site query.

WP_Site_Query::parse_query( string|array $query = '' ) #

Parses arguments passed to the site query with default query parameters.


Description

Top ↑

See also


Top ↑

Parameters

$query

(string|array)(Optional)Array or string of WP_Site_Query arguments. See WP_Site_Query::__construct().

Default value: ''


Top ↑

Source

File: wp-includes/class-wp-site-query.php

	public function parse_query( $query = '' ) {
		if ( empty( $query ) ) {
			$query = $this->query_vars;
		}

		$this->query_vars = wp_parse_args( $query, $this->query_var_defaults );

		/**
		 * Fires after the site query vars have been parsed.
		 *
		 * @since 4.6.0
		 *
		 * @param WP_Site_Query $query The WP_Site_Query instance (passed by reference).
		 */
		do_action_ref_array( 'parse_site_query', array( &$this ) );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.6.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.