WP_MS_Sites_List_Table::get_primary_column_aria_label
Returns a clean label for the primary (URL) column's row header aria-label.
Provides screen readers with just the site title as the row header name, preventing them from computing the name from the full cell content.
Method of the class: WP_MS_Sites_List_Table{}
No Hooks.
Returns
string. The site title, or the site URL (domain + path) if the title is empty.
Usage
// protected - for code of main (parent) or child class $result = $this->get_primary_column_aria_label( $blog );
- $blog(array) (required)
- The current site properties array.
Changelog
| Since 7.1.0 | Introduced. |
WP_MS_Sites_List_Table::get_primary_column_aria_label() WP MS Sites List Table::get primary column aria label code WP 7.1
protected function get_primary_column_aria_label( $blog ) {
$blog_name = html_entity_decode( (string) get_blog_option( $blog['blog_id'], 'blogname', '' ), ENT_QUOTES, get_bloginfo( 'charset' ) );
$blog_name = wp_strip_all_tags( $blog_name );
// Fall back to the blog URL and path if the blog name is empty.
return '' !== $blog_name ? $blog_name : untrailingslashit( $blog['domain'] . $blog['path'] );
}