WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/02/2013 03:52:23 AM (8 years ago)
Author:
azaozz
Message:

Remove all screen_icon() calls and deprecate the functions, props TobiasBg, fixes #26119

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/screen.php

    r26456 r26518  
    123123
    124124    $current_screen->add_option( $option, $args );
    125 }
    126 
    127 /**
    128  * Displays a screen icon.
    129  *
    130  * @uses get_screen_icon()
    131  * @since 2.7.0
    132  *
    133  * @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
    134  *  which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
    135  */
    136 function screen_icon( $screen = '' ) {
    137     echo get_screen_icon( $screen );
    138 }
    139 
    140 /**
    141  * Gets a screen icon.
    142  *
    143  * @since 3.2.0
    144  *
    145  * @global $post_ID
    146  * @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
    147  *  which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
    148  * @return string HTML for the screen icon.
    149  */
    150 function get_screen_icon( $screen = '' ) {
    151     if ( empty( $screen ) )
    152         $screen = get_current_screen();
    153     elseif ( is_string( $screen ) )
    154         $icon_id = $screen;
    155 
    156     $class = 'icon32';
    157 
    158     if ( empty( $icon_id ) ) {
    159         if ( ! empty( $screen->parent_base ) )
    160             $icon_id = $screen->parent_base;
    161         else
    162             $icon_id = $screen->base;
    163 
    164         if ( 'page' == $screen->post_type )
    165             $icon_id = 'edit-pages';
    166 
    167         if ( $screen->post_type )
    168             $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type );
    169     }
    170 
    171     return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>';
    172125}
    173126
Note: See TracChangeset for help on using the changeset viewer.