Title: WP_Comments_List_Table::get_columns
Published: April 25, 2014
Last modified: February 24, 2026

---

# WP_Comments_List_Table::get_columns(): string[]

## In this article

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

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

## 󠀁[Return](https://developer.wordpress.org/reference/classes/wp_comments_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_comments_list_table/get_columns/?output_format=md#source)󠁿

    ```php
    public function get_columns() {
    	global $post_id;

    	$columns = array();

    	if ( $this->checkbox ) {
    		$columns['cb'] = '<input type="checkbox" />';
    	}

    	$columns['author']  = __( 'Author' );
    	$columns['comment'] = _x( 'Comment', 'column name' );

    	if ( ! $post_id ) {
    		/* translators: Column name or table row header. */
    		$columns['response'] = __( 'In response to' );
    	}

    	$columns['date'] = _x( 'Submitted on', 'column name' );

    	return $columns;
    }
    ```

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

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

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

Retrieves the translation of $text.

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

Retrieves translated string with gettext context.

  |

## User Contributed Notes

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