WC_Query::parse_request()publicWC 1.0

Parse the request and look for query vars - endpoints may not be supported.

Method of the class: WC_Query{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Query = new WC_Query();
$WC_Query->parse_request();

WC_Query::parse_request() code WC 8.7.0

public function parse_request() {
	global $wp;

	// phpcs:disable WordPress.Security.NonceVerification.Recommended
	// Map query vars to their keys, or get them if endpoints are not supported.
	foreach ( $this->get_query_vars() as $key => $var ) {
		if ( isset( $_GET[ $var ] ) ) {
			$wp->query_vars[ $key ] = sanitize_text_field( wp_unslash( $_GET[ $var ] ) );
		} elseif ( isset( $wp->query_vars[ $var ] ) ) {
			$wp->query_vars[ $key ] = $wp->query_vars[ $var ];
		}
	}
	// phpcs:enable WordPress.Security.NonceVerification.Recommended
}