diff --git src/wp-admin/menu-header.php src/wp-admin/menu-header.php
index a32f3a5..35c461c 100644
|
|
function _wp_menu_output( $menu, $submenu, $submenu_as_parent = true ) { |
83 | 83 | // so an icon can be added to div.wp-menu-image as background with CSS. |
84 | 84 | // Dashicons and base64-encoded data:image/svg_xml URIs are also handled as special cases. |
85 | 85 | if ( ! empty( $item[6] ) ) { |
86 | | $img = '<img src="' . $item[6] . '" alt="" />'; |
87 | | |
| 86 | $img_info = array( 'img' => '<img src="' . $item[6] . '" alt="" />', ); |
| 87 | |
88 | 88 | if ( 'none' === $item[6] || 'div' === $item[6] ) { |
89 | | $img = '<br />'; |
| 89 | $img_info['img'] = '<br />'; |
90 | 90 | } elseif ( 0 === strpos( $item[6], 'data:image/svg+xml;base64,' ) ) { |
91 | | $img = '<br />'; |
92 | | $img_style = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"'; |
93 | | $img_class = ' svg'; |
| 91 | $img_info['img'] = '<br />'; |
| 92 | $img_info['img_style'] = ' style="background-image:url(\'' . esc_attr( $item[6] ) . '\')"'; |
| 93 | $img_info['img_class'] = ' svg'; |
94 | 94 | } elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) { |
95 | | $img = '<br />'; |
96 | | $img_class = ' dashicons ' . sanitize_html_class( $item[6] ); |
| 95 | $img_info['img'] = '<br />'; |
| 96 | $img_info['img_class'] = ' dashicons ' . sanitize_html_class( $item[6] ); |
97 | 97 | } |
| 98 | |
| 99 | $img_info = apply_filters('admin_img_class', $img_info, $item[6]); |
| 100 | extract($img_info); |
98 | 101 | } |
99 | 102 | $arrow = '<div class="wp-menu-arrow"><div></div></div>'; |
100 | 103 | |
diff --git src/wp-admin/menu.php src/wp-admin/menu.php
index 5a53cff..997c2e0 100644
|
|
foreach ( (array) get_post_types( array('show_ui' => true, '_builtin' => false, |
109 | 109 | $ptype_for_id = sanitize_html_class( $ptype ); |
110 | 110 | |
111 | 111 | if ( is_string( $ptype_obj->menu_icon ) ) { |
112 | | // Special handling for data:image/svg+xml and Dashicons. |
113 | | if ( 0 === strpos( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) || 0 === strpos( $ptype_obj->menu_icon, 'dashicons-' ) ) { |
114 | | $menu_icon = $ptype_obj->menu_icon; |
115 | | } else { |
116 | | $menu_icon = esc_url( $ptype_obj->menu_icon ); |
| 112 | $menu_icon = false; |
| 113 | $iconClasses = array('dashicons-'); |
| 114 | $iconClasses = apply_filters('admin_icon_classes', $iconClasses); |
| 115 | |
| 116 | foreach ($iconClasses as $iconClass) { |
| 117 | if ( 0 === strpos( $ptype_obj->menu_icon, $iconClass ) ) { |
| 118 | $menu_icon = $ptype_obj->menu_icon; |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | if (! $menu_icon ) { |
| 123 | if ( 0 === strpos( $ptype_obj->menu_icon, 'data:image/svg+xml;base64,' ) ) { |
| 124 | $menu_icon = $ptype_obj->menu_icon; |
| 125 | } else { |
| 126 | $menu_icon = esc_url( $ptype_obj->menu_icon ); |
| 127 | } |
117 | 128 | } |
118 | 129 | $ptype_class = $ptype_for_id; |
119 | 130 | } else { |