diff --git a/src/wp-includes/class-wp-admin-bar.php b/src/wp-includes/class-wp-admin-bar.php index ce1464e125..69021f527b 100644 --- a/src/wp-includes/class-wp-admin-bar.php +++ b/src/wp-includes/class-wp-admin-bar.php @@ -550,16 +550,19 @@ class WP_Admin_Bar { if ( $has_link ) { $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); echo "meta['onclick'] ) ) { - echo ' onclick="' . esc_js( $node->meta['onclick'] ) . '"'; - } } else { $attributes = array( 'onclick', 'target', 'title', 'rel', 'lang', 'dir' ); echo '
meta[ $attribute ] ) ) { + if ( empty( $node->meta[ $attribute ] ) ) { + continue; + } + + if ( 'onclick' === $attribute ) { + echo " $attribute='" . esc_js( $node->meta[ $attribute ] ) . "'"; + } else { echo " $attribute='" . esc_attr( $node->meta[ $attribute ] ) . "'"; } }