Make WordPress Core


Ignore:
Timestamp:
04/21/2022 06:02:21 AM (2 years ago)
Author:
peterwilsoncc
Message:

Posts, Post Types: Fix option validation in stick_post().

Normalize an invalid sticky_posts option to an empty array within stick_post(). This fixes a bug in which an unexpected option value would prevent new posts from being made sticky.

Follow up to [50380].

Props azouamauriac, denishua, kajalgohel, sergeybiryukov, costdev.
Fixes #55176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r53170 r53238  
    28962896
    28972897    if ( ! is_array( $stickies ) ) {
    2898         $stickies = array( $post_id );
     2898        $stickies = array();
    28992899    } else {
    29002900        $stickies = array_unique( array_map( 'intval', $stickies ) );
Note: See TracChangeset for help on using the changeset viewer.