WP_MS_Sites_List_Table::get_primary_column_aria_label │ protected │ WP 7.1.0

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.

Метод класса: WP_MS_Sites_List_Table{}

Хуков нет.

Возвращает

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

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_primary_column_aria_label( $blog );
$blog(массив) (обязательный)
The current site properties array.

Список изменений

С версии 7.1.0 Введена.

Код WP_MS_Sites_List_Table::get_primary_column_aria_label() WP 7.1.4

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