Make WordPress Core

Ticket #30970: 30970.2.patch

File 30970.2.patch, 678 bytes (added by mordauk, 11 years ago)
  • src/wp-includes/query.php

     
    45684568         *
    45694569         * @since 4.1.0
    45704570         *
    4571          * @param WP_Post $post Post data.
     4571         * @param WP_Post $p Post data or post ID.
    45724572         * @return bool True when finished.
    45734573         */
    45744574        public function setup_postdata( $post ) {
    45754575                global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
    45764576
     4577                if ( ! ( $post instanceof WP_Post ) ) {
     4578                        $post = get_post( $post );
     4579                }
     4580
    45774581                $id = (int) $post->ID;
    45784582
    45794583                $authordata = get_userdata($post->post_author);