[wp-trac] [WordPress Trac] #35163: wp_get_archives() returns unresolved query string

WordPress Trac noreply at wordpress.org
Thu Oct 24 05:39:57 UTC 2019


#35163: wp_get_archives() returns unresolved query string
--------------------------+-------------------------
 Reporter:  hogetan       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  General       |     Version:  4.4
 Severity:  normal        |  Resolution:  worksforme
 Keywords:                |     Focuses:
--------------------------+-------------------------
Changes (by dd32):

 * status:  new => closed
 * resolution:   => worksforme


Comment:

 It looks to me that this is working as expected.

 The archives that the function deals with, are all post-specific.

 Another example:
 {{{ wp_get_archives('post_type=page&type=monthly' ); }}}
 will generate links like this:
 {{{
 https://wordpress.site/2019/10/?post_type=page
 https://wordpress.site/2019/09/?post_type=page
 }}}

 Those URLs will 404 unless the `post_type` specified has also been
 included into the global posts loops through a `pre_get_posts` filter.

 It feels like the original report here had other filters in use which were
 adding the post_type into the URI, potentially the `month_link` filter or
 from within `$wp_rewrite->get_month_permastruct()`.

 I'm going to close this as `worksforme`, since it seems correct. If you're
 experiencing this issue, please feel free to re-open with specifics on how
 to reproduce on a clean environment without other filters.

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


More information about the wp-trac mailing list