manage_columns_prefs

Definition:
function manage_columns_prefs( $page ) {}

Parameters

  • unknown_type $page

Source code

function manage_columns_prefs( $page ) {

	$columns = get_column_headers( $page );

	$hidden  = get_hidden_columns( $page );

	$special = array('_title', 'cb', 'comment', 'media', 'name', 'title', 'username');



	foreach ( $columns as $column => $title ) {

		// Can't hide these or they are special

		if ( in_array( $column, $special ) )

			continue;

		if ( empty( $title ) )

			continue;



		if ( 'comments' == $column )

			$title = __( 'Comments' );

		$id = "$column-hide";

		echo '<label for="' . $id . '">';

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

		echo "$title</label>\n";

	}

}

2321

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: