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
This commit is contained in:
Ryan Boren 2012-08-23 19:28:58 +00:00
parent 1c44b15e63
commit 6248d6221c
1 changed files with 2 additions and 5 deletions

View File

@ -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' ) );