From 6248d6221c563c927ebbc2c13f129a5bcd2aa14f Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 23 Aug 2012 19:28:58 +0000 Subject: [PATCH] Don't overwrite the post global in _get_page_link(). see #21309 git-svn-id: http://core.svn.wordpress.org/trunk@21596 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index d7f7ddd7c5..2a9e2a45d4 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -266,12 +266,9 @@ function get_page_link( $id = false, $leavename = false, $sample = false ) { * @return string */ function _get_page_link( $id = false, $leavename = false, $sample = false ) { - global $post, $wp_rewrite; + global $wp_rewrite; - if ( !$id ) - $id = (int) $post->ID; - else - $post = &get_post($id); + $post = get_post( $id ); $draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );