[wp-trac] [WordPress Trac] #43056: Notice in redirect_guess_404_permalink() when post type is an array
WordPress Trac
noreply at wordpress.org
Sat Aug 15 07:13:33 UTC 2020
#43056: Notice in redirect_guess_404_permalink() when post type is an array
--------------------------------------+----------------------------
Reporter: junaidbhura | Owner: peterwilsoncc
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 5.6
Component: Canonical | Version:
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+----------------------------
Changes (by peterwilsoncc):
* owner: (none) => peterwilsoncc
* status: new => assigned
Comment:
@junaidbhura I've modified your patch slightly in
[https://github.com/WordPress/wordpress-develop/pull/480 PR 480 on the
GitHub repo]:
* The escaping was a little out, `$wpdb->prepare()` can't be used for `IN`
so the query would have being incorrect, it would have looked for a post
type of an apparently random concatenation of the post types. I've
replaced that with the counter-intuitive method of correctly escaping
`LIKE`s.
* I've added some unit tests too for array formatted post types. I've used
the publicly queryable post types in a query string rather than the
`pre_get_posts` filter example in your initial report.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/43056#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list