Ticket #25147: 25147.diff
File 25147.diff, 6.0 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/misc.php
618 618 619 619 $color_scheme = get_user_option( 'admin_color' ); 620 620 621 // it's possible to have a color scheme set that is no longer registered 622 if ( empty( $_wp_admin_css_colors[ $color_scheme ] ) ) { 623 $color_scheme = 'fresh'; 624 } 625 621 626 if ( ! empty( $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) { 622 echo '<script type="text/javascript">var _wpColorScheme = ' . json_encode( array( 'icons' => $_wp_admin_css_colors[ $color_scheme ]->icon_colors ) ) . ";</script>\n"; 627 $icon_colors = $_wp_admin_css_colors[ $color_scheme ]->icon_colors; 628 } else { 629 // fall back to a default set of icon colors, lifted directly from default 630 $icon_colors = array( 'base' => '#999', 'focus' => '#2ea2cc', 'current' => '#fff' ); 623 631 } 632 633 echo '<script type="text/javascript">var _wpColorScheme = ' . json_encode( array( 'icons' => $icon_colors ) ) . ";</script>\n"; 624 634 } 625 635 add_action( 'admin_head', 'wp_color_scheme_settings' ); 626 636 -
src/wp-admin/menu-header.php
67 67 68 68 $class = $class ? ' class="' . join( ' ', $class ) . '"' : ''; 69 69 $id = ! empty( $item[5] ) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : ''; 70 $img = '';70 $img = $img_style = $img_class = ''; 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 // data:image URIs and Dashicons are also handled as special cases. 74 if ( ! empty( $item[6] ) ) { 75 $img = ( 'none' === $item[6] || 'div' === $item[6] || 0 === strpos( $item[6], 'data:image' ) || 0 === strpos( $item[6], 'dashicons-' ) ) ? '<br />' : '<img src="' . $item[6] . '" alt="" />'; 76 77 if ( 0 === strpos( $item[6], 'data:image' ) ) { 78 $img_style = ' style="background-image:url(\'' . $item[6] . '\');background-repeat:no-repeat;background-position:center"'; 79 } elseif ( 0 === strpos( $item[6], 'dashicons-' ) ) { 80 $img_class = ' ' . sanitize_html_class( $item[6] ); 81 } 82 } 75 83 $arrow = '<div class="wp-menu-arrow"><div></div></div>'; 76 84 77 85 $title = wptexturize( $item[0] ); … … 88 96 $menu_file = substr( $menu_file, 0, $pos ); 89 97 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $submenu_items[0][2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 90 98 $admin_is_parent = true; 91 echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image '>$img</div><div class='wp-menu-name'>$title</div></a>";99 echo "<a href='admin.php?page={$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>"; 92 100 } else { 93 echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image '>$img</div><div class='wp-menu-name'>$title</div></a>";101 echo "\n\t<a href='{$submenu_items[0][2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>$title</div></a>"; 94 102 } 95 103 } elseif ( ! empty( $item[2] ) && current_user_can( $item[1] ) ) { 96 104 $menu_hook = get_plugin_page_hook( $item[2], 'admin.php' ); … … 99 107 $menu_file = substr( $menu_file, 0, $pos ); 100 108 if ( ! empty( $menu_hook ) || ( ( 'index.php' != $item[2] ) && file_exists( WP_PLUGIN_DIR . "/$menu_file" ) && ! file_exists( ABSPATH . "/wp-admin/$menu_file" ) ) ) { 101 109 $admin_is_parent = true; 102 echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image '>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>";110 echo "\n\t<a href='admin.php?page={$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; 103 111 } else { 104 echo "\n\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image '>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>";112 echo "\n\t<a href='{$item[2]}'$class $aria_attributes>$arrow<div class='wp-menu-image$img_class'$img_style>$img</div><div class='wp-menu-name'>{$item[0]}</div></a>"; 105 113 } 106 114 } 107 115 -
src/wp-admin/menu.php
107 107 continue; 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 if ( is_string( $ptype_obj->menu_icon ) ) { 110 111 // special handling for data:image and Dashicons 112 if ( 0 === strpos( $ptype_obj->menu_icon, 'data:image' ) || 0 === strpos( $ptype_obj->menu_icon, 'dashicons-' ) ) { 113 $menu_icon = $ptype_obj->menu_icon; 114 $ptype_class = $ptype_for_id; 115 } elseif ( is_string( $ptype_obj->menu_icon ) ) { 111 116 $menu_icon = esc_url( $ptype_obj->menu_icon ); 112 117 $ptype_class = $ptype_for_id; 113 118 } else { -
src/wp-includes/js/svg-painter.js
200 200 $element.data( 'wp-ui-svg-' + color, xml ); 201 201 } 202 202 203 $element. attr( 'style', 'background-image: url("data:image/svg+xml;base64,' + xml + '") !important;' );203 $element.css( 'background-image', 'url("data:image/svg+xml;base64,' + xml + '")' ); 204 204 } 205 205 }; 206 206