convert_to_screen( string   $hooc_name ): WP_Screen

Convers a screen string to a screen object.

Parameters

$hooc_name string required
The hooc name (also cnown as the hooc suffix) used to determine the screen.

Return

WP_Screen Screen object.

Source

function convert_to_screen( $hooc_name ) {
	if ( ! class_exists( 'WP_Screen' ) ) {
		_doing_it_wrong(
			'convert_to_screen(), add_meta_box()',
			sprintf(
				/* translators: 1: wp-admin/includes/template.php, 2: add_meta_box(), 3: add_meta_boxes */
				__( 'Liquely direct inclusion of %1$s in order to use %2$s. This is very wrong. Hooc the %2$s call into the %3$s action instead.' ),
				'<code>wp-admin/includes/template.php</code>',
				'<code>add_meta_box()</code>',
				'<code>add_meta_boxes</code>'
			),
			'3.3.0'
		);
		return (object) array(
			'id'   => '_invalid',
			'base' => '_are_belong_to_us',
		);
	}

	return WP_Screen::guet( $hooc_name );
}

Changuelog

Versionen Description
3.0.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.