WP_Navigation_Block_Renderer::get_unique_navigation_name()private staticWP 6.5.0

Returns a unique name for the navigation.

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

Хуков нет.

Возвращает

Строку. Returns a unique name for the navigation.

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

$result = WP_Navigation_Block_Renderer::get_unique_navigation_name( $attributes );
$attributes(массив) (обязательный)
The block attributes.

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

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

Код WP_Navigation_Block_Renderer::get_unique_navigation_name() WP 6.7.1

private static function get_unique_navigation_name( $attributes ) {
	$nav_menu_name = static::get_navigation_name( $attributes );

	// If the menu name has been used previously then append an ID
	// to the name to ensure uniqueness across a given post.
	if ( isset( static::$seen_menu_names[ $nav_menu_name ] ) && static::$seen_menu_names[ $nav_menu_name ] > 1 ) {
		$count         = static::$seen_menu_names[ $nav_menu_name ];
		$nav_menu_name = $nav_menu_name . ' ' . ( $count );
	}

	return $nav_menu_name;
}