Don't overwrite the post global in _get_page_link(). see #21309

git-svn-id: https://develop.svn.wordpress.org/trunk@21596 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-08-23 19:28:58 +00:00
parent e49b0dd8ea
commit 861a8fb246
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' ) );