mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 06:10:09 +00:00
After [34200], force 'before' and 'after' to <ul> and </ul> when wp_nav_menu() falls back to wp_page_menu().
See #11095. git-svn-id: https://develop.svn.wordpress.org/trunk@34653 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1264,10 +1264,21 @@ function wp_page_menu( $args = array() ) {
|
||||
$list_args['title_li'] = '';
|
||||
$menu .= str_replace( array( "\r", "\n", "\t" ), '', wp_list_pages($list_args) );
|
||||
|
||||
$container = sanitize_text_field( $args['container'] );
|
||||
|
||||
if ( $menu ) {
|
||||
|
||||
// wp_nav_menu doesn't set before and after
|
||||
if ( isset( $args['fallback_cb'] ) &&
|
||||
'wp_page_menu' === $args['fallback_cb'] &&
|
||||
'ul' !== $container ) {
|
||||
$args['before'] = '<ul>';
|
||||
$args['after'] = '</ul>';
|
||||
}
|
||||
|
||||
$menu = $args['before'] . $menu . $args['after'];
|
||||
}
|
||||
$container = sanitize_text_field( $args['container'] );
|
||||
|
||||
$attrs = '';
|
||||
if ( ! empty( $args['menu_id'] ) ) {
|
||||
$attrs .= ' id="' . esc_attr( $args['menu_id'] ) . '"';
|
||||
|
||||
Reference in New Issue
Block a user