Ticket #25147: 25147.menu_icon_data_image_v1.patch
File 25147.menu_icon_data_image_v1.patch, 1.6 KB (added by , 11 years ago) |
---|
-
wp-admin/menu-header.php
70 70 $img = ''; 71 71 // if the string 'none' (previously 'div') is passed instead of an URL, don't output the default menu image 72 72 // so an icon can be added to div.wp-menu-image as background with CSS. 73 if ( ! empty( $item[6] ) ) 74 $img = ( 'none' === $item[6] || 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />'; 73 if ( ! empty( $item[6] ) ) { 74 $attr = preg_match( '/^data:image\b/m', $item[6] ) ? ' height="16px" width="16px"' : ''; 75 $img = ( 'none' === $item[6] || 'div' === $item[6] ) ? '<br />' : '<img src="' . $item[6] . '" alt=""' . $attr . ' />'; 76 } 75 77 $arrow = '<div class="wp-menu-arrow"><div></div></div>'; 76 78 77 79 $title = wptexturize( $item[0] ); -
wp-admin/menu.php
108 108 $ptype_menu_position = is_int( $ptype_obj->menu_position ) ? $ptype_obj->menu_position : ++$_wp_last_object_menu; // If we're to use $_wp_last_object_menu, increment it first. 109 109 $ptype_for_id = sanitize_html_class( $ptype ); 110 110 if ( is_string( $ptype_obj->menu_icon ) ) { 111 $menu_icon = esc_url( $ptype_obj->menu_icon );111 $menu_icon = preg_match( '/data:image/', $ptype_obj->menu_icon ) ? $ptype_obj->menu_icon : esc_url( $ptype_obj->menu_icon ); 112 112 $ptype_class = $ptype_for_id; 113 113 } else { 114 114 $menu_icon = 'none';