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:
Scott Taylor 2014-05-15 01:22:15 +00:00
parent 29d8832625
commit 7b8d797355

View File

@ -1009,7 +1009,6 @@ function wp_list_pages( $args = '' ) {
);
$r = wp_parse_args( $args, $defaults );
extract( $r, EXTR_SKIP );
$output = '';
$current_page = 0;
@ -1034,9 +1033,9 @@ function wp_list_pages( $args = '' ) {
$pages = get_pages( $r );
if ( ! empty( $pages ) ) {
if ( $r['title_li'] )
if ( $r['title_li'] ) {
$output .= '<li class="pagenav">' . $r['title_li'] . '<ul>';
}
global $wp_query;
if ( is_page() || is_attachment() || $wp_query->is_posts_page ) {
$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 );
if ( $r['title_li'] )
if ( $r['title_li'] ) {
$output .= '</ul></li>';
}
}
/**
* Filter the HTML output of the pages to list.
@ -1060,15 +1060,16 @@ function wp_list_pages( $args = '' ) {
*
* @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.
*/
$output = apply_filters( 'wp_list_pages', $output, $r );
$html = apply_filters( 'wp_list_pages', $output, $r );
if ( $r['echo'] )
echo $output;
else
return $output;
if ( $r['echo'] ) {
echo $html;
} else {
return $html;
}
}
/**