[wp-trac] [WordPress Trac] #15551: Custom post type pagination redirect

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 26 12:21:29 UTC 2010


#15551: Custom post type pagination redirect
--------------------------+-------------------------------------------------
 Reporter:  cbsad         |       Owner:                 
     Type:  defect (bug)  |      Status:  new            
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  3.1            
 Severity:  normal        |    Keywords:                 
--------------------------+-------------------------------------------------

Comment(by tott):

 A simple workaround could be disabling the canonical redirect for this
 particular case.

 A possible solution could look like this. I'm not sure if this would be
 the preferred way to do this, though.

 {{{
 function no_canonical( $url ) {
         return false;
 }
 function adjust_show_request( $request ) {
         if ($request->query_vars['post_type'] === 'show' &&
 $request->is_singular === true && $request->current_post == -1 &&
 $request->is_paged === true ) {
                 add_filter( 'redirect_canonical', 'no_canonical' );
         }
         return $request;
 }
 add_action( 'parse_query', 'adjust_show_request' );
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15551#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list