Advertisements

convert_to_screen

Definition:
function convert_to_screen( $screen ) {}

Convert a screen string to a screen object

Parameters

  • string $hook_name: The hook name (also known as the hook suffix) used to determine the screen.

Return values

returns:Screen object.

Defined filters

  • screen_meta_screen
    apply_filters( 'screen_meta_screen', $screen )

Source code

function convert_to_screen( $screen ) {

	$screen = str_replace( array('.php', '-new', '-add', '-network', '-user' ), '', $screen);



	if ( is_network_admin() )

		$screen .= '-network';

	elseif ( is_user_admin() )

		$screen .= '-user';



	$screen = (string) apply_filters( 'screen_meta_screen', $screen );

	$screen = (object) array('id' => $screen, 'base' => $screen);

	return $screen;

}

725

Advertisements

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: