Title: WP_Terms_List_Table::get_columns
Published: April 25, 2014
Last modified: April 28, 2025

---

# WP_Terms_List_Table::get_columns(): string[]

## In this article

 * [Return](https://developer.wordpress.org/reference/classes/wp_terms_list_table/get_columns/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/classes/wp_terms_list_table/get_columns/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/classes/wp_terms_list_table/get_columns/?output_format=md#related)

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

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

 string[] Array of column titles keyed by their column name.

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

    ```php
    public function get_columns() {
    	$columns = array(
    		'cb'          => '<input type="checkbox" />',
    		'name'        => _x( 'Name', 'term name' ),
    		'description' => __( 'Description' ),
    		'slug'        => __( 'Slug' ),
    	);

    	if ( 'link_category' === $this->screen->taxonomy ) {
    		$columns['links'] = __( 'Links' );
    	} else {
    		$columns['posts'] = _x( 'Count', 'Number/count of items' );
    	}

    	return $columns;
    }
    ```

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

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

| Uses | Description | 
| [_x()](https://developer.wordpress.org/reference/functions/_x/)`wp-includes/l10n.php` |

Retrieves translated string with gettext context.

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

Retrieves the translation of $text.

  |

## User Contributed Notes

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