Make WordPress Core

Ticket #55176: 55176.4.diff

File 55176.4.diff, 576 bytes (added by azouamauriac, 3 years ago)

55176.3.diff contains undesirable changes. this last is good.

  • src/wp-includes/post.php

     
    29082908 */
    29092909function stick_post( $post_id ) {
    29102910        $post_id  = (int) $post_id;
    2911         $stickies = get_option( 'sticky_posts' );
     2911        $stickies = get_option( 'sticky_posts', array() );
    29122912        $updated  = false;
    29132913
    2914         if ( ! is_array( $stickies ) ) {
    2915                 $stickies = array( $post_id );
    2916         } else {
     2914        if ( $stickies ) {
    29172915                $stickies = array_unique( array_map( 'intval', $stickies ) );
    29182916        }
    29192917