Filter hook 'do_parse_request'

in WP Core File wp-includes/class-wp.php at line 148

View Source

do_parse_request

Filter Hook
Description
Filters whether to parse the request.

Hook Information

File Location wp-includes/class-wp.php View on GitHub
Hook Type Filter
Line Number 148

Hook Parameters

Type Name Description
bool $bool Whether or not to parse the request. Default true.
WP $wp Current WordPress environment instance.
array|string $extra_query_vars Extra passed query variables.

Usage Examples

Basic Usage
<?php
// Hook into do_parse_request
add_filter('do_parse_request', 'my_custom_filter', 10, 3);

function my_custom_filter($bool, $wp, $extra_query_vars) {
    // Your custom filtering logic here
    return $bool;
}

Source Code Context

wp-includes/class-wp.php:148 - How this hook is used in WordPress core
<?php
 143  		 *
 144  		 * @param bool         $bool             Whether or not to parse the request. Default true.
 145  		 * @param WP           $wp               Current WordPress environment instance.
 146  		 * @param array|string $extra_query_vars Extra passed query variables.
 147  		 */
 148  		if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) {
 149  			return false;
 150  		}
 151  
 152  		$this->query_vars     = array();
 153  		$post_type_query_vars = array();

PHP Documentation

<?php
/**
		 * Filters whether to parse the request.
		 *
		 * @since 3.5.0
		 *
		 * @param bool         $bool             Whether or not to parse the request. Default true.
		 * @param WP           $wp               Current WordPress environment instance.
		 * @param array|string $extra_query_vars Extra passed query variables.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 3
  • File: wp-includes/class-wp.php
Related Hooks

Related hooks will be displayed here in future updates.