Check page ID only if is_page. fixes #3049
git-svn-id: https://develop.svn.wordpress.org/trunk@4863 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
10550fe0cd
commit
ae8cc717ac
|
@ -273,6 +273,7 @@ function wp_list_pages($args = '') {
|
||||||
$r = array_merge($defaults, $r);
|
$r = array_merge($defaults, $r);
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
$current_page = 0;
|
||||||
|
|
||||||
// sanitize, mostly to keep spaces out
|
// sanitize, mostly to keep spaces out
|
||||||
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
|
$r['exclude'] = preg_replace('[^0-9,]', '', $r['exclude']);
|
||||||
|
@ -288,6 +289,7 @@ function wp_list_pages($args = '') {
|
||||||
$output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
|
$output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
|
||||||
|
|
||||||
global $wp_query;
|
global $wp_query;
|
||||||
|
if ( is_page() )
|
||||||
$current_page = $wp_query->get_queried_object_id();
|
$current_page = $wp_query->get_queried_object_id();
|
||||||
$output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
|
$output .= walk_page_tree($pages, $r['depth'], $current_page, $r);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue