[wp-meta] [Making WordPress.org] #6531: Error in pagination in plugin results, loading different query

Making WordPress.org noreply at wordpress.org
Tue Nov 1 03:06:22 UTC 2022


#6531: Error in pagination in plugin results, loading different query
------------------------------+---------------------
 Reporter:  alvarogois        |       Owner:  (none)
     Type:  defect (bug)      |      Status:  new
 Priority:  normal            |   Milestone:
Component:  Plugin Directory  |  Resolution:
 Keywords:                    |
------------------------------+---------------------

Comment (by dd32):

 I can confirm that this isn't coming from WordPress.org code, it appears
 to be a bug in Core's Canonical.

 https://core.trac.wordpress.org/browser/trunk/src/wp-
 includes/canonical.php?rev=53043&marks=430,437,443#L427

 Filed an upstream issue: https://core.trac.wordpress.org/ticket/56937

 Thank you for bringing this up @alvarogois.

 We could patch around this on the plugin directory, this works as expected
 for me:
 {{{
 // Make paginated versions of /tags/feed accessible. #core56937
 add_filter( 'redirect_canonical', function( $redirect_url, $requested_url
 ) {
         if (
                 str_contains( $requested_url, '/tags/feed/' ) &&
                 ! str_contains( $redirect_url, '/tags/feed/' )
         ) {
                 $redirect_url = str_replace( '/tags/', '/tags/feed/',
 $redirect_url );
         }

         return $redirect_url;
 }, 1, 2 );
 }}}

-- 
Ticket URL: <https://meta.trac.wordpress.org/ticket/6531#comment:3>
Making WordPress.org <https://meta.trac.wordpress.org/>
Making WordPress.org


More information about the wp-meta mailing list