wpseek.com
A WordPress-centric search engine for devs and theme authors



block_core_breadcrumbs_create_item › WordPress Function

Since7.0.0
Deprecatedn/a
block_core_breadcrumbs_create_item ( $text, $is_paged = false )
Parameters: (2)
  • (string) $text The text content.
    Required: Yes
  • (bool) $is_paged Whether we're on a paginated view.
    Required: No
    Default: false
Returns:
  • (array) The breadcrumb item data.
Defined at:
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.


Source

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