mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-14 14:45:45 +01:00
Check page ID only if is_page. fixes #3049
git-svn-id: http://svn.automattic.com/wordpress/branches/2.1@4864 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9a8d98cb3d
commit
edf6e21ebd
@ -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'] )
|
||||
|
Loading…
Reference in New Issue
Block a user