[wp-trac] [WordPress Trac] #17337: wp_old_slug_redirect() fails with multiple post_type query

WordPress Trac wp-trac at lists.automattic.com
Fri May 6 10:36:19 UTC 2011


#17337: wp_old_slug_redirect() fails with multiple post_type query
--------------------------+-----------------------------
 Reporter:  joehoyle      |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Canonical     |    Version:  3.1
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If I have a query something like this:

 {{{
 [query_vars] => Array
         (
             [name] => panasonic-tv-review
             [post_type] => Array
                 (
                     [0] => review
                     [1] => small_review
                 )
         )
 }}}

 The new post slug is "panasonic-250-tv-review", and there is a
 `_wp_old_slug` meta key with the old slug. One would expect
 `wp_old_slug_redirect()` to kick in and do the redirect. However,
 `wp_old_slug_redirect()` will fail with a query with multiple post types,
 (looking at http://core.trac.wordpress.org/browser/trunk/wp-
 includes/query.php#L3494). This will knock the `$wpdb->prepare()` ass
 `$post_type` is now an array.

 I can write a patch for this if I can get the go ahead.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/17337>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list