wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



block_core_breadcrumbs_create_item › WordPress Function

Seit7.0.0
Veraltetn/v
block_core_breadcrumbs_create_item ( $text, $is_paged = false )
Parameter: (2)
  • (string) $text The text content.
    Erforderlich: Ja
  • (bool) $is_paged Whether we're on a paginated view.
    Erforderlich: Nein
    Standard: false
Gibt zurück:
  • (array) The breadcrumb item data.
Definiert in:
Codex:

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.


Quellcode

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;
}