WP_List_Table::get_default_primary_column_name(): string

Gets the name of the default primary column.


Return

string Name of the default primary column, in this case, an empty string.


Top ↑

Source

File: wp-admin/includes/class-wp-list-table.php. View all references

protected function get_default_primary_column_name() {
	$columns = $this->get_columns();
	$column  = '';

	if ( empty( $columns ) ) {
		return $column;
	}

	/*
	 * We need a primary defined so responsive views show something,
	 * so let's fall back to the first non-checkbox column.
	 */
	foreach ( $columns as $col => $column_name ) {
		if ( 'cb' === $col ) {
			continue;
		}

		$column = $col;
		break;
	}

	return $column;
}


Top ↑

Changelog

Changelog
Version Description
4.3.0 Introduced.

Top ↑

User Contributed Notes

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