WordPress.org

Make WordPress Core

Ticket #26119: 26199-deprecate-move-functions.patch

File 26199-deprecate-move-functions.patch, 3.5 KB (added by TobiasBg, 8 years ago)

Deprecate and move screen icon functions

  • src/wp-admin/includes/deprecated.php

    diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php
    index e6d42ab..ff87729 100644
    a b function wp_update_theme($theme, $feedback = '') { 
    11341134function the_attachment_links( $id = false ) {
    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}
     1188 No newline at end of file
  • src/wp-admin/includes/screen.php

    diff --git a/src/wp-admin/includes/screen.php b/src/wp-admin/includes/screen.php
    index 2ab5161..8b7eba9 100644
    a b function add_screen_option( $option, $args = array() ) { 
    125125}
    126126
    127127/**
    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>';
    172 }
    173 
    174 /**
    175128 * Get the current screen object
    176129 *
    177130 * @since 3.1.0