Opened 4 years ago
Closed 4 years ago
#55829 closed defect (bug) (fixed)
Doc error on ticket 10886
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | WordPress.org | Priority: | normal |
| Severity: | normal | Version: | 6.0 |
| Component: | Bootstrap/Load | Keywords: | |
| Focuses: | docs | Cc: |
Description
This is a follow-up to #10886.
The example, pasted to many places, has two problems:
- it contains unbalanced parenthesis
- $this is not a valid parameter. I believe the function expects ($do_parse, $wp, $extra_query_vars)
function wporg_add_custom_query( $do_parse, $this, $extra_query_vars ) {
if ( 'CUSTOM_VALUE' === $extra_query_vars['custom_arg'] {
return false;
}
return $do_parse;
}
add_filter( 'do_parse_request', 'wporg_add_custom_query' );
Change History (1)
Note: See
TracTickets for help on using
tickets.
Hi there, welcome to WordPress Trac! Thanks for the ticket.
Just to clarify for anyone looking at this, it's about this post: Changes to do_parse_request filter in WordPress 6.0.
Good catch! There is also an issue with the
add_filter()call there, it should specify the number of arguments:Otherwise, only the first argument is actually passed to the filter.
I have updated the post to correct these issues.