function convert_to_screen( $screen ) {}

Convert a screen string to a screen object


  • 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;



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: Logo

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

Facebook photo

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

Connecting to %s

%d bloggers like this: