WP_Posts_List_Table::get_primary_column_aria_label( WP_Post $item ): string

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

Description

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).

Parameters

$itemWP_Postrequired
The current post object.

Return

string The post title, or ‘no title’ if no title.

Source

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

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.