[wp-trac] [WordPress Trac] #35031: wp_old_slug_redirect() in 4.4 redirecting existing posts

WordPress Trac noreply at wordpress.org
Thu Dec 17 13:12:27 UTC 2015


#35031: wp_old_slug_redirect() in 4.4 redirecting existing posts
-------------------------------------------------+-------------------------
 Reporter:  douglsmith                           |       Owner:  pento
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.4.1
Component:  Query                                |     Version:  4.4
 Severity:  critical                             |  Resolution:
 Keywords:  has-patch needs-unit-tests needs-    |     Focuses:
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by strategio):

 Here's a temporary fix which works for me:

 {{{#!php
 function fix_35012_wp_old_slug() {
         global $wp_query;

         if ( $wp_query->post_count > 0 ) {
                 remove_action( 'template_redirect',
 'wp_old_slug_redirect' );
         }
 }
 add_action( 'template_redirect', 'fix_35012_wp_old_slug', 5 );
 }}}

 More details here: https://wpml.org/forums/topic/after-updating-wpmlwp-
 some-posts-automatically-redirect-to-english-version/page/2/#post-771536

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35031#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list