Check page ID only if is_page. fixes #3049

git-svn-id: http://svn.automattic.com/wordpress/trunk@4863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2007-02-02 16:38:26 +00:00
parent 16c4e7b986
commit 86f90f6c3d

View File

@ -273,6 +273,7 @@ function wp_list_pages($args = '') {
$r = array_merge($defaults, $r);
$output = '';
$current_page = 0;
// sanitize, mostly to keep spaces out
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
@ -288,7 +289,8 @@ function wp_list_pages($args = '') {
$output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
global $wp_query;
$current_page = $wp_query->get_queried_object_id();
if ( is_page() )
$current_page = $wp_query->get_queried_object_id();
$output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
if ( $r['title_li'] )