Ticket #19878: screen_icon.patch
| File screen_icon.patch, 1.3 KB (added by wpsmith, 16 months ago) |
|---|
-
screen.php
135 135 * which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID. 136 136 */ 137 137 function screen_icon( $screen = '' ) { 138 echo get_screen_icon( $screen);138 echo apply_filters ( 'wp_screen_icon' , get_screen_icon( $screen ) ); 139 139 } 140 140 141 141 /** … … 148 148 * @return string HTML for the screen icon. 149 149 */ 150 150 function get_screen_icon( $screen = '' ) { 151 $style = ''; 151 152 if ( empty( $screen ) ) 152 153 $screen = get_current_screen(); 153 154 elseif ( is_string( $screen ) ) 154 155 $icon_id = $screen; 156 elseif ( is_array( $screen ) ) { 157 /* 158 $screen = array ( 159 'name' => 'custom' , 160 'icon' => 'URL', 161 ); 162 */ 163 $icon_id = isset ( $screen['name'] ) ? $screen['name'] : 'custom'; 164 $style = ' style="background:transparent url(' . $screen['icon'] . ') no-repeat;"'; 165 } 155 166 156 167 $class = 'icon32'; 157 168 … … 168 179 $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type ); 169 180 } 170 181 171 return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>';182 return apply_filters ( 'wp_get_screen_icon' , '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"' . $style .'><br /></div>' , $screen ); 172 183 } 173 184 174 185 /**
