Title: WP_List_Table::get_column_info
Published: April 25, 2014
Last modified: May 20, 2026

---

# WP_List_Table::get_column_info(): array<int,

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#return)
 * [More Information](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#more-information)
 * [Source](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#source)
 * [Hooks](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#hooks)
 * [Related](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#wp--skip-link--target)

Gets a list of all, hidden, and sortable columns, with filter applied.

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#return)󠁿

 array<int, `array|string`> Column information.

## 󠀁[More Information](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#more-information)󠁿

This is used by WordPress to build and fetch the _column_headers property. Generally,
this should not be used by developers. Instead, assign the _column_headers property
directly from your prepare_items() method.

## 󠀁[Source](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#source)󠁿

    ```php
    protected function get_column_info() {
    	// $_column_headers is already set / cached.
    	if (
    		isset( $this->_column_headers ) &&
    		is_array( $this->_column_headers )
    	) {
    		/*
    		 * Backward compatibility for `$_column_headers` format prior to WordPress 4.3.
    		 *
    		 * In WordPress 4.3 the primary column name was added as a fourth item in the
    		 * column headers property. This ensures the primary column name is included
    		 * in plugins setting the property directly in the three item format.
    		 */
    		if ( 4 === count( $this->_column_headers ) ) {
    			return $this->_column_headers;
    		}

    		$column_headers = array( array(), array(), array(), $this->get_primary_column_name() );
    		foreach ( $this->_column_headers as $key => $value ) {
    			$column_headers[ $key ] = $value;
    		}

    		$this->_column_headers = $column_headers;

    		return $this->_column_headers;
    	}

    	$columns = get_column_headers( $this->screen );
    	$hidden  = get_hidden_columns( $this->screen );

    	$sortable_columns = $this->get_sortable_columns();
    	/**
    	 * Filters the list table sortable columns for a specific screen.
    	 *
    	 * The dynamic portion of the hook name, `$this->screen->id`, refers
    	 * to the ID of the current screen.
    	 *
    	 * @since 3.1.0
    	 *
    	 * @param array $sortable_columns An array of sortable columns.
    	 */
    	$_sortable = apply_filters( "manage_{$this->screen->id}_sortable_columns", $sortable_columns );

    	$sortable = array();
    	foreach ( $_sortable as $id => $data ) {
    		if ( empty( $data ) ) {
    			continue;
    		}

    		$data = (array) $data;
    		// Descending initial sorting.
    		if ( ! isset( $data[1] ) ) {
    			$data[1] = false;
    		}
    		// Current sorting translatable string.
    		if ( ! isset( $data[2] ) ) {
    			$data[2] = '';
    		}
    		// Initial view sorted column and asc/desc order, default: false.
    		if ( ! isset( $data[3] ) ) {
    			$data[3] = false;
    		}
    		// Initial order for the initial sorted column, default: false.
    		if ( ! isset( $data[4] ) ) {
    			$data[4] = false;
    		}

    		$sortable[ $id ] = $data;
    	}

    	$primary               = $this->get_primary_column_name();
    	$this->_column_headers = array( $columns, $hidden, $sortable, $primary );

    	return $this->_column_headers;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/class-wp-list-table.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/class-wp-list-table.php#L1298)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/class-wp-list-table.php#L1298-L1372)

## 󠀁[Hooks](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#hooks)󠁿

 [apply_filters( “manage_{$this->screen->id}_sortable_columns”, array $sortable_columns )](https://developer.wordpress.org/reference/hooks/manage_this-screen-id_sortable_columns/)

Filters the list table sortable columns for a specific screen.

## 󠀁[Related](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#related)󠁿

| Uses | Description | 
| [WP_List_Table::get_primary_column_name()](https://developer.wordpress.org/reference/classes/wp_list_table/get_primary_column_name/)`wp-admin/includes/class-wp-list-table.php` |

Gets the name of the primary column.

  | 
| [get_column_headers()](https://developer.wordpress.org/reference/functions/get_column_headers/)`wp-admin/includes/screen.php` |

Get the column headers for a screen

  | 
| [get_hidden_columns()](https://developer.wordpress.org/reference/functions/get_hidden_columns/)`wp-admin/includes/screen.php` |

Get a list of hidden columns.

  | 
| [WP_List_Table::get_sortable_columns()](https://developer.wordpress.org/reference/classes/wp_list_table/get_sortable_columns/)`wp-admin/includes/class-wp-list-table.php` |

Gets a list of sortable columns.

  | 
| [apply_filters()](https://developer.wordpress.org/reference/functions/apply_filters/)`wp-includes/plugin.php` |

Calls the callback functions that have been added to a filter hook.

  |

[Show 1 more](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#)

| Used by | Description | 
| [WP_List_Table::print_table_description()](https://developer.wordpress.org/reference/classes/wp_list_table/print_table_description/)`wp-admin/includes/class-wp-list-table.php` |

Print a table description with information about current sorting and order.

  | 
| [WP_List_Table::single_row_columns()](https://developer.wordpress.org/reference/classes/wp_list_table/single_row_columns/)`wp-admin/includes/class-wp-list-table.php` |

Generates the columns for a single row of the table.

  | 
| [WP_List_Table::get_column_count()](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_count/)`wp-admin/includes/class-wp-list-table.php` |

Returns the number of visible columns.

  | 
| [WP_List_Table::print_column_headers()](https://developer.wordpress.org/reference/classes/wp_list_table/print_column_headers/)`wp-admin/includes/class-wp-list-table.php` |

Prints column headers, accounting for hidden and sortable columns.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/classes/wp_list_table/get_column_info/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.1.0](https://developer.wordpress.org/reference/since/3.1.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fclasses%2Fwp_list_table%2Fget_column_info%2F)
before being able to contribute a note or feedback.