From 2671e9cc726b7f3cf500624a161b1168ffd78430 Mon Sep 17 00:00:00 2001 From: nacin Date: Tue, 14 Sep 2010 16:48:38 +0000 Subject: [PATCH] Some docs and corrections to _wp_link_page(). git-svn-id: http://svn.automattic.com/wordpress/trunk@15617 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/post-template.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index 034248c6f6..7eb7a2fe2e 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -616,18 +616,27 @@ function wp_link_pages($args = '') { return $output; } +/** + * Helper function for wp_link_pages(). + * + * @since 3.1.0 + * @access private + * + * @param $i Page number. + * @return string Link. + */ function _wp_link_page( $i ) { global $post, $wp_rewrite; if ( 1 == $i ) { - $url .= get_permalink(); + $url = get_permalink(); } else { if ( '' == get_option('permalink_structure') || in_array($post->post_status, array('draft', 'pending')) ) $url = add_query_arg( 'page', $i, get_permalink() ); elseif ( 'page' == get_option('show_on_front') && get_option('page_on_front') == $post->ID ) $url = trailingslashit(get_permalink()) . user_trailingslashit("$wp_rewrite->pagination_base/" . $i, 'single_paged'); else - $url .= trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged'); + $url = trailingslashit(get_permalink()) . user_trailingslashit($i, 'single_paged'); } return '';