WP_MS_Sites_List_Table::get_primary_column_aria_label( array $blog ): string

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

Description

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

Parameters

$blogarrayrequired
The current site properties array.

Return

string The site title, or the site URL (domain + path) if the title is empty.

Source

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'] );
}

Changelog

VersionDescription
7.1.0Introduced.

User Contributed Notes

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