WC_Query::parse_request
Parse the request and look for query vars - endpoints may not be supported.
Method of the class: WC_Query{}
No Hooks.
Returns
null. Nothing (null).
Usage
$WC_Query = new WC_Query(); $WC_Query->parse_request();
WC_Query::parse_request() WC Query::parse request code WC 10.8.1
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
}