Changeset 50380 for trunk/src/wp-includes/post.php
- Timestamp:
- 02/17/2021 10:56:34 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r50266 r50380 2627 2627 $post_id = (int) $post_id; 2628 2628 $stickies = get_option( 'sticky_posts' ); 2629 $updated = false; 2629 2630 2630 2631 if ( ! is_array( $stickies ) ) { 2631 $stickies = array( );2632 } 2633 2634 $stickies = array_map( 'intval', $stickies );2632 $stickies = array( $post_id ); 2633 } else { 2634 $stickies = array_unique( array_map( 'intval', $stickies ) ); 2635 } 2635 2636 2636 2637 if ( ! in_array( $post_id, $stickies, true ) ) { 2637 2638 $stickies[] = $post_id; 2638 } 2639 2640 $updated = update_option( 'sticky_posts', $stickies ); 2639 $updated = update_option( 'sticky_posts', array_values( $stickies ) ); 2640 } 2641 2641 2642 2642 if ( $updated ) { … … 2669 2669 } 2670 2670 2671 $stickies = array_ map( 'intval', $stickies);2671 $stickies = array_values( array_unique( array_map( 'intval', $stickies ) ) ); 2672 2672 2673 2673 if ( ! in_array( $post_id, $stickies, true ) ) {
Note: See TracChangeset
for help on using the changeset viewer.