mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-01 03:04:34 +00:00
Remove all screen_icon() calls and deprecate the functions, props TobiasBg, fixes #26119
git-svn-id: https://develop.svn.wordpress.org/trunk@26518 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -124,53 +124,6 @@ function add_screen_option( $option, $args = array() ) {
|
||||
$current_screen->add_option( $option, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a screen icon.
|
||||
*
|
||||
* @uses get_screen_icon()
|
||||
* @since 2.7.0
|
||||
*
|
||||
* @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
|
||||
* which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
|
||||
*/
|
||||
function screen_icon( $screen = '' ) {
|
||||
echo get_screen_icon( $screen );
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a screen icon.
|
||||
*
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @global $post_ID
|
||||
* @param string|WP_Screen $screen Optional. Accepts a screen object (and defaults to the current screen object)
|
||||
* which it uses to determine an icon HTML ID. Or, if a string is provided, it is used to form the icon HTML ID.
|
||||
* @return string HTML for the screen icon.
|
||||
*/
|
||||
function get_screen_icon( $screen = '' ) {
|
||||
if ( empty( $screen ) )
|
||||
$screen = get_current_screen();
|
||||
elseif ( is_string( $screen ) )
|
||||
$icon_id = $screen;
|
||||
|
||||
$class = 'icon32';
|
||||
|
||||
if ( empty( $icon_id ) ) {
|
||||
if ( ! empty( $screen->parent_base ) )
|
||||
$icon_id = $screen->parent_base;
|
||||
else
|
||||
$icon_id = $screen->base;
|
||||
|
||||
if ( 'page' == $screen->post_type )
|
||||
$icon_id = 'edit-pages';
|
||||
|
||||
if ( $screen->post_type )
|
||||
$class .= ' ' . sanitize_html_class( 'icon32-posts-' . $screen->post_type );
|
||||
}
|
||||
|
||||
return '<div id="icon-' . esc_attr( $icon_id ) . '" class="' . $class . '"><br /></div>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current screen object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user