mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-05 07:58:35 +01:00
Eliminate use of extract()
in wp_list_pages()
which, surprisingly, didn't even use any of the extracted variables.
See #22400. Built from https://develop.svn.wordpress.org/trunk@28401 git-svn-id: http://core.svn.wordpress.org/trunk@28228 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
29d8832625
commit
7b8d797355
@ -1009,7 +1009,6 @@ function wp_list_pages( $args = '' ) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
$r = wp_parse_args( $args, $defaults );
|
$r = wp_parse_args( $args, $defaults );
|
||||||
extract( $r, EXTR_SKIP );
|
|
||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
$current_page = 0;
|
$current_page = 0;
|
||||||
@ -1034,9 +1033,9 @@ function wp_list_pages( $args = '' ) {
|
|||||||
$pages = get_pages( $r );
|
$pages = get_pages( $r );
|
||||||
|
|
||||||
if ( ! empty( $pages ) ) {
|
if ( ! empty( $pages ) ) {
|
||||||
if ( $r['title_li'] )
|
if ( $r['title_li'] ) {
|
||||||
$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() || is_attachment() || $wp_query->is_posts_page ) {
|
if ( is_page() || is_attachment() || $wp_query->is_posts_page ) {
|
||||||
$current_page = get_queried_object_id();
|
$current_page = get_queried_object_id();
|
||||||
@ -1049,9 +1048,10 @@ function wp_list_pages( $args = '' ) {
|
|||||||
|
|
||||||
$output .= walk_page_tree( $pages, $r['depth'], $current_page, $r );
|
$output .= walk_page_tree( $pages, $r['depth'], $current_page, $r );
|
||||||
|
|
||||||
if ( $r['title_li'] )
|
if ( $r['title_li'] ) {
|
||||||
$output .= '</ul></li>';
|
$output .= '</ul></li>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter the HTML output of the pages to list.
|
* Filter the HTML output of the pages to list.
|
||||||
@ -1060,15 +1060,16 @@ function wp_list_pages( $args = '' ) {
|
|||||||
*
|
*
|
||||||
* @see wp_list_pages()
|
* @see wp_list_pages()
|
||||||
*
|
*
|
||||||
* @param string $output HTML output of the pages list.
|
* @param string $html HTML output of the pages list.
|
||||||
* @param array $r An array of page-listing arguments.
|
* @param array $r An array of page-listing arguments.
|
||||||
*/
|
*/
|
||||||
$output = apply_filters( 'wp_list_pages', $output, $r );
|
$html = apply_filters( 'wp_list_pages', $output, $r );
|
||||||
|
|
||||||
if ( $r['echo'] )
|
if ( $r['echo'] ) {
|
||||||
echo $output;
|
echo $html;
|
||||||
else
|
} else {
|
||||||
return $output;
|
return $html;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user