#33984 closed defect (bug) (invalid)
Wp_Query on tag & category based posts not getting when use + sign.
Reported by: | ravipatel | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 2.2.1 |
Component: | Query | Keywords: | |
Focuses: | template | Cc: |
Description
https://wordpress.org/support/topic/wp_query-on-tag-based-not-getting-post-when-use-sign
$query = new WP_Query( 'category_name=facebook,uncategorized' ); (work) $query = new WP_Query( 'category_name=facebook+uncategorized' );(Not work)
Our support Question. We have testing code by developers get issue this technique not working please review and change on web.
Change History (2)
Note: See
TracTickets for help on using
tickets.
It seems that since we run
parse_str
when the value is submitted as a string (as opposed to an array), the+
sign is omitted as a space, using the URL Encoded variant of it%2B
produces the expected result, as does providing the WP_Query arguments as an arraynew WP_Query( array( 'category_name' => 'facebook+uncategorized' ) );
Since this is the behavior of
parse_str
, a native PHP function, I'm going to suggest this isn't something we can (or should be) messing with as it might break expected backwards compatibility for other existing implementations