WP_Posts_List_Table::get_primary_column_aria_label │ protected │ WP 7.1.0

Returns a clean label for the primary (title) column's row header aria-label.

Provides screen readers with just the post title as the row header name, preventing them from computing the name from the full cell content (which includes row action links, post states, and possibly an excerpt).

Method of the class: WP_Posts_List_Table{}

No Hooks.

Returns

string. The post title, or 'no title' if no title.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_primary_column_aria_label( $item );
$item(WP_Post) (required)
The current post object.

Changelog

Since 7.1.0 Introduced.

WP_Posts_List_Table::get_primary_column_aria_label() code WP 7.1.2

protected function get_primary_column_aria_label( $item ) {
	return isset( $item->post_title ) && ! empty( $item->post_title ) ? $item->post_title : __( 'no title' );
}