WP_List_Table::get_default_primary_column_name()protectedWP 4.3.0

Gets the name of the default primary column.

Метод класса: WP_List_Table{}

Хуков нет.

Возвращает

Строку. Name of the default primary column, in this case, an empty string.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_default_primary_column_name();

Список изменений

С версии 4.3.0 Введена.

Код WP_List_Table::get_default_primary_column_name() WP 6.5.2

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