Ticket #19080: 19080.2.diff
| File 19080.2.diff, 1.4 KB (added by , 14 years ago) |
|---|
-
wp-admin/includes/screen.php
179 179 * @return string HTML for the screen icon. 180 180 */ 181 181 function get_screen_icon( $screen = '' ) { 182 global $typenow; 183 182 184 if ( empty( $screen ) ) 183 185 $screen = get_current_screen(); 184 186 elseif ( is_string( $screen ) ) … … 192 194 else 193 195 $icon_id = $screen->base; 194 196 195 if ( 'page' == $screen->post_type ) 197 if ( $screen->post_type ) 198 $post_type = $screen->post_type; 199 else 200 $post_type = $typenow; 201 202 if ( 'page' == $post_type ) 196 203 $icon_id = 'edit-pages'; 197 204 198 if ( $ screen->post_type )199 $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $ screen->post_type );205 if ( $post_type ) 206 $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type ); 200 207 } 201 208 202 209 return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>'; … … 524 531 function set_current_screen() { 525 532 global $current_screen, $taxnow, $typenow; 526 533 $current_screen = $this; 527 $taxnow = $this->taxonomy; 528 $typenow = $this->post_type; 534 switch ( $this->base ) { 535 case 'edit-tags' : 536 $taxnow = $this->taxonomy; 537 // Fall through. 538 case 'edit' : 539 case 'post' : 540 $typenow = $this->post_type; 541 break; 542 } 529 543 $current_screen = apply_filters( 'current_screen', $current_screen ); 530 544 } 531 545