get_screen_icon

Definition:
function get_screen_icon( $screen = '' ) {}

Parameters

  • $screen

Source code

function get_screen_icon( $screen = '' ) {

	global $current_screen, $typenow;



	if ( empty($screen) )

		$screen = $current_screen;

	elseif ( is_string($screen) )

		$name = $screen;



	$class = 'icon32';



	if ( empty($name) ) {

		if ( !empty($screen->parent_base) )

			$name = $screen->parent_base;

		else

			$name = $screen->base;



		if ( 'edit' == $name && isset($screen->post_type) && 'page' == $screen->post_type )

			$name = 'edit-pages';



		$post_type = '';

		if ( isset( $screen->post_type ) )

			$post_type = $screen->post_type;

		elseif ( $current_screen == $screen )

			$post_type = $typenow;

		if ( $post_type )

			$class .= ' ' . sanitize_html_class( 'icon32-posts-' . $post_type );

	}



	return '<div id="icon-' . esc_attr( $name ) . '" class="' . $class . '"><br /></div>';

}

13967

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: