diff --git a/wp-includes/post-template.php b/wp-includes/post-template.php index b0911f8cd7..d99ba2aa92 100644 --- a/wp-includes/post-template.php +++ b/wp-includes/post-template.php @@ -673,7 +673,11 @@ function wp_page_menu( $args = array() ) { $menu = ''; $menu = '
' . $menu . "
\n"; - echo apply_filters( 'wp_page_menu', $menu ); + $menu = apply_filters( 'wp_page_menu', $menu ); + if ( $args['echo'] ) + echo $menu; + else + return $menu; } //