Allow `wp_page_menu()` to accept `'walker'`, `'before'`, and `'after'` to allow custom markup.

Fixes #11095.

Built from https://develop.svn.wordpress.org/trunk@34200


git-svn-id: http://core.svn.wordpress.org/trunk@34164 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-09-15 15:06:30 +00:00
parent 57d2420ae5
commit 4a34994e54
2 changed files with 14 additions and 5 deletions

View File

@ -1204,7 +1204,16 @@ function wp_list_pages( $args = '' ) {
* @return string|void HTML menu
*/
function wp_page_menu( $args = array() ) {
$defaults = array('sort_column' => 'menu_order, post_title', 'menu_class' => 'menu', 'echo' => true, 'link_before' => '', 'link_after' => '');
$defaults = array(
'sort_column' => 'menu_order, post_title',
'menu_class' => 'menu',
'echo' => true,
'link_before' => '',
'link_after' => '',
'before' => '<ul>',
'after' => '</ul>',
'walker' => ''
);
$args = wp_parse_args( $args, $defaults );
/**
@ -1247,9 +1256,9 @@ function wp_page_menu( $args = array() ) {
$list_args['title_li'] = '';
$menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
if ( $menu )
$menu = '<ul>' . $menu . '</ul>';
if ( $menu ) {
$menu = $args['before'] . $menu . $args['after'];
}
$menu = '<div class="' . esc_attr($args['menu_class']) . '">' . $menu . "</div>\n";
/**

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34188';
$wp_version = '4.4-alpha-34200';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.