[wp-trac] [WordPress Trac] #55207: WP_Query returns published sticky posts when post_status is set to draft

WordPress Trac noreply at wordpress.org
Sun Feb 20 17:17:57 UTC 2022


#55207: WP_Query returns published sticky posts when post_status is set to draft
--------------------------+------------------------------
 Reporter:  NomNom99      |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Query         |     Version:  5.9
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by azouamauriac):

 Hi @NomNom99 , welcome to WordPress Trac! Thanks for the ticket.

 I have two thoughts after reading your report;

 First: just use "''ignore_sticky_post''" option and move forward;
 On second thought, I think this is a bug, when you make a request to
 retrieve drafted posts you should only get drafted posts not a posts with
 other status no matter they are sticky or not.

 After some search, the code was introduced here [8546] 7457, originally
 called ''caller_get_posts'' and renamed ''ignore_sticky_posts'' here
 [15589]/#14624

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


More information about the wp-trac mailing list