Changeset 34089 for trunk/src/wp-includes/query.php
- Timestamp:
- 09/12/2015 08:57:06 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/query.php
r34073 r34089 4617 4617 * 4618 4618 * @since 4.1.0 4619 * @since 4.4.0 Added the ability to pass a post ID to `$post`. 4619 4620 * 4620 4621 * @global int $id … … 4628 4629 * @global int $numpages 4629 4630 * 4630 * @param WP_Post $post Post data.4631 * @param WP_Post|object|int $post WP_Post instance or Post ID/object. 4631 4632 * @return true True when finished. 4632 4633 */ 4633 4634 public function setup_postdata( $post ) { 4634 4635 global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages; 4636 4637 if ( ! ( $post instanceof WP_Post ) ) { 4638 $post = get_post( $post ); 4639 } 4640 4641 if ( ! $post ) { 4642 return; 4643 } 4635 4644 4636 4645 $id = (int) $post->ID; … … 4702 4711 if ( ! empty( $this->post ) ) { 4703 4712 $GLOBALS['post'] = $this->post; 4704 setup_postdata( $this->post );4713 $this->setup_postdata( $this->post ); 4705 4714 } 4706 4715 } … … 4770 4779 * 4771 4780 * @since 1.5.0 4781 * @since 4.4.0 Added the ability to pass a post ID to `$post`. 4772 4782 * 4773 4783 * @global WP_Query $wp_query 4774 4784 * 4775 * @param object $post Post data.4785 * @param WP_Post|object|int $post WP_Post instance or Post ID/object. 4776 4786 * @return bool True when finished. 4777 4787 */
Note: See TracChangeset
for help on using the changeset viewer.