mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Nav Menus: in wp_nav_menu(), $container is already bound to a list of allowed tags. PHP, being its whimsical self, while return true if someone sets $container to true via in_array( true, [ 'div', 'nav' ] ). Check that $container is a string before the in_array() check. 'true' does not pass.
Props shedonist for the original patch. Fixes #32464. git-svn-id: https://develop.svn.wordpress.org/trunk@34630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b45a72a67c
commit
61d6854bae
@ -334,7 +334,7 @@ function wp_nav_menu( $args = array() ) {
|
||||
* Default is array containing 'div' and 'nav'.
|
||||
*/
|
||||
$allowed_tags = apply_filters( 'wp_nav_menu_container_allowedtags', array( 'div', 'nav' ) );
|
||||
if ( in_array( $args->container, $allowed_tags ) ) {
|
||||
if ( is_string( $args->container ) && in_array( $args->container, $allowed_tags ) ) {
|
||||
$show_container = true;
|
||||
$class = $args->container_class ? ' class="' . esc_attr( $args->container_class ) . '"' : ' class="menu-'. $menu->slug .'-container"';
|
||||
$id = $args->container_id ? ' id="' . esc_attr( $args->container_id ) . '"' : '';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user