[wp-trac] [WordPress Trac] #23475: Feed querystring not limiting returned posts by post type when also using category

WordPress Trac noreply at wordpress.org
Thu May 22 15:04:15 UTC 2014


#23475: Feed querystring not limiting returned posts by post type when also using
category
--------------------------+-------------------------
 Reporter:  jpyper        |       Owner:
     Type:  defect (bug)  |      Status:  closed
 Priority:  normal        |   Milestone:
Component:  Query         |     Version:  3.5.1
 Severity:  normal        |  Resolution:  worksforme
 Keywords:  close         |     Focuses:
--------------------------+-------------------------

Comment (by Jpyper):

 Well, I'm 10 months more experienced than I was when I reported this as a
 bug. I was able to find that the real reason for this happening was my own
 code. In order to get my custom post type to show up in archives along
 with posts, I've hooked into pre_get_posts and checked for is_archive()
 and is_category() before changing the query's post type to... wait for
 it... array('post', 'syndicated')

 I did not realize that this would affect a feed. Adding in an is_feed()
 check to NOT do this fixed the problem.

 Thanks for your help and follow up, sorry for the time waster :(

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


More information about the wp-trac mailing list