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:
parent
1c44b15e63
commit
6248d6221c
|
@ -266,12 +266,9 @@ function get_page_link( $id = false, $leavename = false, $sample = false ) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function _get_page_link( $id = false, $leavename = false, $sample = false ) {
|
function _get_page_link( $id = false, $leavename = false, $sample = false ) {
|
||||||
global $post, $wp_rewrite;
|
global $wp_rewrite;
|
||||||
|
|
||||||
if ( !$id )
|
$post = get_post( $id );
|
||||||
$id = (int) $post->ID;
|
|
||||||
else
|
|
||||||
$post = &get_post($id);
|
|
||||||
|
|
||||||
$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
$draft_or_pending = in_array( $post->post_status, array( 'draft', 'pending', 'auto-draft' ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue