Changeset 26518 for trunk/src/wp-admin/includes/screen.php
- Timestamp:
- 12/02/2013 03:52:23 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/screen.php
r26456 r26518 123 123 124 124 $current_screen->add_option( $option, $args ); 125 }126 127 /**128 * Displays a screen icon.129 *130 * @uses get_screen_icon()131 * @since 2.7.0132 *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.0144 *145 * @global $post_ID146 * @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 else162 $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 125 } 173 126
Note: See TracChangeset
for help on using the changeset viewer.