Ticket #25495: 25495-patch.2.diff
File 25495-patch.2.diff, 4.1 KB (added by , 7 years ago) |
---|
-
wp-includes/class-wp.php
120 120 function parse_request($extra_query_vars = '') { 121 121 global $wp_rewrite; 122 122 123 /** 124 * Filter to test if parse_request() should be run or not. 125 * 126 * Hook here and return false to stop parse_request() from proceeding. 127 * 128 * @since 3.5.0 129 * 130 * @param bool true Wether or not to run parse_request. 131 * @param WP $this The WordPress environment instance. 132 * @param array|string $extra_query_vars The extra query variables passed. 133 */ 123 134 if ( ! apply_filters( 'do_parse_request', true, $this, $extra_query_vars ) ) 124 135 return; 125 136 … … 236 247 } 237 248 } 238 249 239 $this->public_query_vars = apply_filters('query_vars', $this->public_query_vars); 250 $this->public_query_vars; 251 /** 252 * Filter the query variables whitelist before processing. 253 * 254 * Allows (publicly allowed) query vars to be added, removed, or changed changed prior 255 * to executing the query. Needed to allow custom rewrite rules using your own arguments 256 * to work, or any other custom query variables you want usable on the public side. 257 * 258 * @since 1.5.2 259 * 260 * @param array $public_query_vars The array of whitelisted query variables. 261 */ 262 $this->public_query_vars = apply_filters( 'query_vars', $public_query_vars ); 240 263 241 264 foreach ( get_post_types( array(), 'objects' ) as $post_type => $t ) 242 265 if ( $t->query_var ) … … 294 317 if ( isset($error) ) 295 318 $this->query_vars['error'] = $error; 296 319 297 $this->query_vars = apply_filters('request', $this->query_vars); 320 $query_vars = $this->query_vars; 321 /** 322 * Filter the query variables array before parsing. 323 * 324 * @since 2.1.0 325 * 326 * @param array $query_vars The array of requested query variables. 327 */ 328 $this->query_vars = apply_filters( 'request', $query_vars ); 298 329 299 do_action_ref_array('parse_request', array(&$this)); 330 /** 331 * Fires actions to be run after parse_request is complete. 332 * 333 * @since 2.1.0 334 * 335 * @param WP &$this The WordPress environment instance (passed by reference). 336 */ 337 do_action_ref_array( 'parse_request', array( &$this ) ); 300 338 } 301 339 302 340 /** … … 366 404 } 367 405 } 368 406 369 $headers = apply_filters('wp_headers', $headers, $this); 407 /** 408 * Filter the HTTP headers before they're sent to the browser. 409 * 410 * @since 2.8.0 411 * 412 * @param array $headers The list of headers to be sent. 413 * @param WP $this The WordPress environment instance. 414 */ 415 $headers = apply_filters( 'wp_headers', $headers, $this ); 370 416 371 417 if ( ! empty( $status ) ) 372 418 status_header( $status ); … … 396 442 if ( $exit_required ) 397 443 exit(); 398 444 399 do_action_ref_array('send_headers', array(&$this)); 445 /** 446 * Fires actions to be run after send_headers() is complete. 447 * 448 * @since 2.1.0 449 * 450 * @param WP &$this The WordPress environment instance (passed by reference). 451 */ 452 do_action_ref_array( 'send_headers', array( &$this ) ); 400 453 } 401 454 402 455 /** … … 420 473 421 474 // query_string filter deprecated. Use request filter instead. 422 475 if ( has_filter('query_string') ) { // Don't bother filtering and parsing if no plugins are hooked in. 423 $this->query_string = apply_filters('query_string', $this->query_string); 476 /** 477 * Filter the query string before parsing. 478 * 479 * @deprecated Use 'query_vars' or 'request' instead. 480 * 481 * @since 1.5.2 482 * 483 * @param string $query_string The query string to modify. 484 */ 485 $this->query_string = apply_filters( 'query_string', $this->query_string ); 424 486 parse_str($this->query_string, $this->query_vars); 425 487 } 426 488 } … … 549 611 $this->query_posts(); 550 612 $this->handle_404(); 551 613 $this->register_globals(); 552 do_action_ref_array('wp', array(&$this)); 614 615 /** 616 * Fires actions to be run at the end of WP environment setup. 617 * 618 * @since 2.1.0 619 * 620 * @param WP &$this The WordPress environment instance (passed by reference). 621 */ 622 do_action_ref_array( 'wp', array( &$this ) ); 553 623 } 554 624 555 625 }