[wp-trac] [WordPress Trac] #60276: Fatal error with unexpected string value for sticky_posts option

WordPress Trac noreply at wordpress.org
Sun Jan 21 19:41:17 UTC 2024


#60276: Fatal error with unexpected string value for sticky_posts option
-------------------------------+-----------------------------
 Reporter:  mreishus           |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Future Release
Component:  General            |     Version:
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |     Focuses:
-------------------------------+-----------------------------

Comment (by themearts):

 I can give it a shot. I think I can check to see wether the option is an
 empty string then don't merge it.

 $query['post__not_in'] = ($sticky !== '' && is_array($sticky)) ?
 array_merge( $query['post__not_in'], $sticky ) : $query['post__not_in'];

 Have not tested the codes. Just an idea.

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


More information about the wp-trac mailing list