Make WordPress Core


Ignore:
Timestamp:
12/02/2013 03:52:23 AM (13 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/deprecated.php

    r26220 r26518  
    11351135        _deprecated_function( __FUNCTION__, '3.7' );
    11361136}
     1137
     1138/**
     1139 * Displays a screen icon.
     1140 *
     1141 * @uses get_screen_icon()
     1142 * @since 2.7.0
     1143 * @deprecated 3.8.0
     1144 *
     1145 * @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
     1146 *      which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
     1147 */
     1148function screen_icon( $screen = '' ) {
     1149        _deprecated_function( __FUNCTION__, '3.8' );
     1150        echo get_screen_icon( $screen );
     1151}
     1152
     1153/**
     1154 * Gets a screen icon.
     1155 *
     1156 * @since 3.2.0
     1157 * @deprecated 3.8.0
     1158 *
     1159 * @global $post_ID
     1160 * @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
     1161 *      which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
     1162 * @return string HTML for the screen icon.
     1163 */
     1164function get_screen_icon( $screen = '' ) {
     1165        _deprecated_function( __FUNCTION__, '3.8' );
     1166        if ( empty( $screen ) )
     1167                $screen = get_current_screen();
     1168        elseif ( is_string( $screen ) )
     1169                $icon_id = $screen;
     1170
     1171        $class = 'icon32';
     1172
     1173        if ( empty( $icon_id ) ) {
     1174                if ( ! empty( $screen->parent_base ) )
     1175                        $icon_id = $screen->parent_base;
     1176                else
     1177                        $icon_id = $screen->base;
     1178
     1179                if ( 'page' == $screen->post_type )
     1180                        $icon_id = 'edit-pages';
     1181
     1182                if ( $screen->post_type )
     1183                        $class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type );
     1184        }
     1185
     1186        return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>';
     1187}
Note: See TracChangeset for help on using the changeset viewer.