WP_Media_List_Table::get_primary_column_aria_label
Returns a clean label for the primary (File) column's row header aria-label.
Provides screen readers with just the attachment title as the row header name, preventing them from computing the name from the full cell content.
Method of the class: WP_Media_List_Table{}
No Hooks.
Returns
string. The attachment title.
Usage
// protected - for code of main (parent) or child class $result = $this->get_primary_column_aria_label( $post );
- $post(WP_Post) (required)
- The current WP_Post object.
Changelog
| Since 7.1.0 | Introduced. |
WP_Media_List_Table::get_primary_column_aria_label() WP Media List Table::get primary column aria label code WP 7.1.2
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;
}