- $tabindex = ' tabindex="1"';
- $id = ! empty($item[5]) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
- $img = '';
- if ( ! empty($item[6]) ) {
- if ( 'div' === $item[6] )
+ $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
+ $img = $img_style = '';
+ $img_class = ' dashicons-before';
+
+ if ( false !== strpos( $class, 'wp-menu-separator' ) ) {
+ $is_separator = true;
+ }
+
+ /*
+ * If the string 'none' (previously 'div') is passed instead of an URL, don't output
+ * the default menu image so an icon can be added to div.wp-menu-image as background
+ * with CSS. Dashicons and base64-encoded data:image/svg_xml URIs are also handled
+ * as special cases.
+ */
+ if ( ! empty( $item[6] ) ) {
+ $img = '<img src="' . $item[6] . '" alt="" />';
+
+ if ( 'none' === $item[6] || 'div' === $item[6] ) {