--- a/wp/wp-includes/class-walker-nav-menu.php Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/class-walker-nav-menu.php Tue Dec 15 13:49:49 2020 +0100
@@ -50,7 +50,7 @@
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
*/
- public function start_lvl( &$output, $depth = 0, $args = array() ) {
+ public function start_lvl( &$output, $depth = 0, $args = null ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
@@ -89,7 +89,7 @@
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of wp_nav_menu() arguments.
*/
- public function end_lvl( &$output, $depth = 0, $args = array() ) {
+ public function end_lvl( &$output, $depth = 0, $args = null ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
@@ -115,7 +115,7 @@
* @param stdClass $args An object of wp_nav_menu() arguments.
* @param int $id Current item ID.
*/
- public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
+ public function start_el( &$output, $item, $depth = 0, $args = null, $id = 0 ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
@@ -203,7 +203,7 @@
$attributes = '';
foreach ( $atts as $attr => $value ) {
- if ( ! empty( $value ) ) {
+ if ( is_scalar( $value ) && '' !== $value && false !== $value ) {
$value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
$attributes .= ' ' . $attr . '="' . $value . '"';
}
@@ -259,7 +259,7 @@
* @param int $depth Depth of page. Not Used.
* @param stdClass $args An object of wp_nav_menu() arguments.
*/
- public function end_el( &$output, $item, $depth = 0, $args = array() ) {
+ public function end_el( &$output, $item, $depth = 0, $args = null ) {
if ( isset( $args->item_spacing ) && 'discard' === $args->item_spacing ) {
$t = '';
$n = '';
@@ -270,4 +270,4 @@
$output .= "</li>{$n}";
}
-} // Walker_Nav_Menu
+}