block_core_breadcrumbs_create_item() │ WP 7.0.0

Creates a breadcrumb item that's either a link or current page item.

When paginated (is_paged is true), creates a link to page 1. Otherwise, creates a span marked as the current page.

Хуков нет.

Возвращает

array. The breadcrumb item data.

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

block_core_breadcrumbs_create_item( $text, $is_paged );
$text(строка) (обязательный)
The text content.
$is_paged(true|false)
Whether we're on a paginated view.
По умолчанию: false

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

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

Код block_core_breadcrumbs_create_item() WP 7.1.3

function block_core_breadcrumbs_create_item( $text, $is_paged = false ) {
	$item = array( 'label' => $text );
	if ( $is_paged ) {
		$item['url'] = get_pagenum_link( 1 );
	}
	return $item;
}