From b33d0da84c0282916bfaa367d4116c4d3e7d795e Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Mon, 2 Dec 2013 03:52:23 +0000 Subject: [PATCH] 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 --- src/wp-admin/comment.php | 1 - src/wp-admin/custom-background.php | 1 - src/wp-admin/custom-header.php | 2 - src/wp-admin/edit-comments.php | 1 - src/wp-admin/edit-form-advanced.php | 1 - src/wp-admin/edit-form-comment.php | 1 - src/wp-admin/edit-link-form.php | 1 - src/wp-admin/edit-tag-form.php | 1 - src/wp-admin/edit-tags.php | 1 - src/wp-admin/edit.php | 1 - src/wp-admin/export.php | 1 - src/wp-admin/import.php | 1 - .../includes/class-wp-upgrader-skins.php | 1 - src/wp-admin/includes/deprecated.php | 51 +++++++++++++++++++ src/wp-admin/includes/screen.php | 47 ----------------- src/wp-admin/index.php | 1 - src/wp-admin/link-manager.php | 1 - src/wp-admin/media-new.php | 1 - src/wp-admin/media.php | 1 - src/wp-admin/ms-delete-site.php | 1 - src/wp-admin/my-sites.php | 1 - src/wp-admin/nav-menus.php | 1 - src/wp-admin/network.php | 1 - src/wp-admin/network/index.php | 1 - src/wp-admin/network/settings.php | 1 - src/wp-admin/network/site-info.php | 1 - src/wp-admin/network/site-new.php | 1 - src/wp-admin/network/site-settings.php | 1 - src/wp-admin/network/site-themes.php | 1 - src/wp-admin/network/site-users.php | 1 - src/wp-admin/network/sites.php | 1 - src/wp-admin/network/themes.php | 3 -- src/wp-admin/network/upgrade.php | 1 - src/wp-admin/network/user-new.php | 1 - src/wp-admin/network/users.php | 3 -- src/wp-admin/options-discussion.php | 1 - src/wp-admin/options-general.php | 1 - src/wp-admin/options-media.php | 1 - src/wp-admin/options-permalink.php | 1 - src/wp-admin/options-reading.php | 1 - src/wp-admin/options-writing.php | 1 - src/wp-admin/options.php | 1 - src/wp-admin/plugin-editor.php | 1 - src/wp-admin/plugin-install.php | 1 - src/wp-admin/plugins.php | 3 -- src/wp-admin/revision.php | 1 - src/wp-admin/theme-editor.php | 1 - src/wp-admin/theme-install.php | 3 -- src/wp-admin/tools.php | 1 - src/wp-admin/update-core.php | 4 -- src/wp-admin/upload.php | 1 - src/wp-admin/user-edit.php | 1 - src/wp-admin/user-new.php | 1 - src/wp-admin/users.php | 3 -- src/wp-admin/widgets.php | 2 - 55 files changed, 51 insertions(+), 115 deletions(-) diff --git a/src/wp-admin/comment.php b/src/wp-admin/comment.php index c2d57f08d9..d4d37ee21d 100644 --- a/src/wp-admin/comment.php +++ b/src/wp-admin/comment.php @@ -115,7 +115,6 @@ case 'spam' :
-

-

updated) ) { ?>
diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 7b1a4b30a5..7f222f7cb7 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -450,7 +450,6 @@ class Custom_Image_Header { ?>
-

updated ) ) { ?> @@ -724,7 +723,6 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> ?>
-

diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php index f084ab5fc5..b12264a02c 100644 --- a/src/wp-admin/edit-comments.php +++ b/src/wp-admin/edit-comments.php @@ -140,7 +140,6 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

-

cap->create_posts ) ) diff --git a/src/wp-admin/edit-form-comment.php b/src/wp-admin/edit-form-comment.php index 6537169d0e..55f8df635b 100644 --- a/src/wp-admin/edit-form-comment.php +++ b/src/wp-admin/edit-form-comment.php @@ -13,7 +13,6 @@ if ( !defined('ABSPATH') ) comment_ID) ?>
-

diff --git a/src/wp-admin/edit-link-form.php b/src/wp-admin/edit-link-form.php index a44944bbe2..d4a38cab56 100644 --- a/src/wp-admin/edit-link-form.php +++ b/src/wp-admin/edit-link-form.php @@ -70,7 +70,6 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

diff --git a/src/wp-admin/edit-tag-form.php b/src/wp-admin/edit-tag-form.php index 5e1ca0eeef..f021b2a3a8 100644 --- a/src/wp-admin/edit-tag-form.php +++ b/src/wp-admin/edit-tag-form.php @@ -27,7 +27,6 @@ if ( 'category' == $taxonomy ) { do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
-

labels->edit_item; ?>

> diff --git a/src/wp-admin/edit-tags.php b/src/wp-admin/edit-tags.php index a253d92f97..56fa11a1c2 100644 --- a/src/wp-admin/edit-tags.php +++ b/src/wp-admin/edit-tags.php @@ -301,7 +301,6 @@ if ( isset( $_REQUEST['message'] ) && ( $msg = (int) $_REQUEST['message'] ) ) { ?>
-

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 8d32036117..e98da90ff1 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -265,7 +265,6 @@ $bulk_counts = array_filter( $bulk_counts ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

labels->name ); if ( current_user_can( $post_type_object->cap->create_posts ) ) diff --git a/src/wp-admin/export.php b/src/wp-admin/export.php index 4f67c08520..e0811c324d 100644 --- a/src/wp-admin/export.php +++ b/src/wp-admin/export.php @@ -144,7 +144,6 @@ function export_date_options( $post_type = 'post' ) { ?>
-

diff --git a/src/wp-admin/import.php b/src/wp-admin/import.php index 076f0d1f3d..e85bf7012b 100644 --- a/src/wp-admin/import.php +++ b/src/wp-admin/import.php @@ -52,7 +52,6 @@ $parent_file = 'tools.php'; ?>
-

%s importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?>

diff --git a/src/wp-admin/includes/class-wp-upgrader-skins.php b/src/wp-admin/includes/class-wp-upgrader-skins.php index 31c5dbb4f5..71a1293e8b 100644 --- a/src/wp-admin/includes/class-wp-upgrader-skins.php +++ b/src/wp-admin/includes/class-wp-upgrader-skins.php @@ -51,7 +51,6 @@ class WP_Upgrader_Skin { return; $this->done_header = true; echo '
'; - screen_icon(); echo '

' . $this->options['title'] . '

'; } function footer() { diff --git a/src/wp-admin/includes/deprecated.php b/src/wp-admin/includes/deprecated.php index e6d42abde8..ff87729a98 100644 --- a/src/wp-admin/includes/deprecated.php +++ b/src/wp-admin/includes/deprecated.php @@ -1134,3 +1134,54 @@ function wp_update_theme($theme, $feedback = '') { function the_attachment_links( $id = false ) { _deprecated_function( __FUNCTION__, '3.7' ); } + +/** + * Displays a screen icon. + * + * @uses get_screen_icon() + * @since 2.7.0 + * @deprecated 3.8.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 = '' ) { + _deprecated_function( __FUNCTION__, '3.8' ); + echo get_screen_icon( $screen ); +} + +/** + * Gets a screen icon. + * + * @since 3.2.0 + * @deprecated 3.8.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 = '' ) { + _deprecated_function( __FUNCTION__, '3.8' ); + 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 '

'; +} \ No newline at end of file diff --git a/src/wp-admin/includes/screen.php b/src/wp-admin/includes/screen.php index 33f91fea63..85ab71248f 100644 --- a/src/wp-admin/includes/screen.php +++ b/src/wp-admin/includes/screen.php @@ -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 '

'; -} - /** * Get the current screen object * diff --git a/src/wp-admin/index.php b/src/wp-admin/index.php index 87cfd709d7..88b1587fd1 100644 --- a/src/wp-admin/index.php +++ b/src/wp-admin/index.php @@ -93,7 +93,6 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

-

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> diff --git a/src/wp-admin/media-new.php b/src/wp-admin/media-new.php index d8f8b63347..75f49f1008 100644 --- a/src/wp-admin/media-new.php +++ b/src/wp-admin/media-new.php @@ -65,7 +65,6 @@ if ( get_user_setting('uploader') || isset( $_GET['browser-uploader'] ) ) $form_class .= ' html-uploader'; ?>
-

diff --git a/src/wp-admin/media.php b/src/wp-admin/media.php index c9f0348359..1462f7d42a 100644 --- a/src/wp-admin/media.php +++ b/src/wp-admin/media.php @@ -103,7 +103,6 @@ case 'edit' : ?>
-

'; -screen_icon(); echo '

' . esc_html( $title ) . '

'; if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_POST['confirmdelete'] ) && $_POST['confirmdelete'] == '1' ) { diff --git a/src/wp-admin/my-sites.php b/src/wp-admin/my-sites.php index 468d1103c6..f882964afc 100644 --- a/src/wp-admin/my-sites.php +++ b/src/wp-admin/my-sites.php @@ -56,7 +56,6 @@ if ( $updated ) { ?>
-

set_help_sidebar( require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-