WP_Media_List_Table::get_primary_column_aria_label( WP_Post $post ): string

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

Description

Provides screen readers with just the attachment title as the row header name, preventing them from computing the name from the full cell content.

Parameters

$postWP_Postrequired
The current WP_Post object.

Return

string The attachment title.

Source

protected function get_primary_column_aria_label( $post ) {
	// The title may contain HTML. The printed aria-label uses esc_attr() later.
	$attachment_title = html_entity_decode( _draft_or_post_title( $post ), ENT_QUOTES, get_bloginfo( 'charset' ) );
	$attachment_title = wp_strip_all_tags( $attachment_title );

	return $attachment_title;
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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