WordPress.org

Make WordPress Core

Ticket #9393: 9393-sticky.diff

File 9393-sticky.diff, 639 bytes (added by nbachiyski, 5 years ago)

Sometimes the sticky option has value of 'Array'. It has been fixed, but until changing it I get the notices. Another check won't harm.

  • wp-includes/query.php

     
    22942294 
    22952295                // Put sticky posts at the top of the posts array 
    22962296                $sticky_posts = get_option('sticky_posts'); 
    2297                 if ( $this->is_home && $page <= 1 && !empty($sticky_posts) && !$q['caller_get_posts'] ) { 
     2297                if ( $this->is_home && $page <= 1 && is_array($sticky_posts) && !empty($sticky_posts) && !$q['caller_get_posts'] ) { 
    22982298                        $num_posts = count($this->posts); 
    22992299                        $sticky_offset = 0; 
    23002300                        // Loop over posts and relocate stickies to the front.