meta_box_prefs

Definition:
function meta_box_prefs($screen) {}

Parameters

  • unknown_type $screen

Source code

function meta_box_prefs($screen) {

	global $wp_meta_boxes;



	if ( is_string($screen) )

		$screen = convert_to_screen($screen);



	if ( empty($wp_meta_boxes[$screen->id]) )

		return;



	$hidden = get_hidden_meta_boxes($screen);



	foreach ( array_keys($wp_meta_boxes[$screen->id]) as $context ) {

		foreach ( array_keys($wp_meta_boxes[$screen->id][$context]) as $priority ) {

			foreach ( $wp_meta_boxes[$screen->id][$context][$priority] as $box ) {

				if ( false == $box || ! $box['title'] )

					continue;

				// Submit box cannot be hidden

				if ( 'submitdiv' == $box['id'] || 'linksubmitdiv' == $box['id'] )

					continue;

				$box_id = $box['id'];

				echo '<label for="' . $box_id . '-hide">';

				echo '<input class="hide-postbox-tog" name="' . $box_id . '-hide" type="checkbox" id="' . $box_id . '-hide" value="' . $box_id . '"' . (! in_array($box_id, $hidden) ? ' checked="checked"' : '') . ' />';

				echo "{$box['title']}</label>\n";

			}

		}

	}

2399

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: