Make WordPress Core

Ticket #55176: 55176.3.diff

File 55176.3.diff, 1.0 KB (added by azouamauriac, 3 years ago)

The previous patch LGTM, I've juste made some optimisations here.

  • src/wp-includes/category-template.php

     
    555555        }
    556556
    557557        // Descendants of exclusions should be excluded too.
    558         if ( true == $parsed_args['hierarchical'] ) {
     558        if ( true === $parsed_args['hierarchical'] ) {
    559559                $exclude_tree = array();
    560560
    561561                if ( $parsed_args['exclude_tree'] ) {
  • 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