mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
Template: Add fallback for empty containers.
Since [14031] the container can be omitted in `wp_nav_menu()`. It can not however in `wp_page_menu()`, which creates a conflict if it is set as the fallback, Let's make sure there is always a valid container tag. Fixes #33974. git-svn-id: https://develop.svn.wordpress.org/trunk@34950 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -1275,6 +1275,11 @@ function wp_page_menu( $args = array() ) {
|
||||
|
||||
$container = sanitize_text_field( $args['container'] );
|
||||
|
||||
// Fallback in case `wp_nav_menu()` was called without a container.
|
||||
if ( empty( $container ) ) {
|
||||
$container = 'div';
|
||||
}
|
||||
|
||||
if ( $menu ) {
|
||||
|
||||
// wp_nav_menu doesn't set before and after
|
||||
|
||||
Reference in New Issue
Block a user