aioseo_breadcrumbs_link_current_item

Purpose

This filter can be used to add or remove the link from the current item in the breadcrumb trail.

Arguments (1)

  1. $linkCurrentItem (boolean) – Keep or remove the link.

Example code snippet

The code snippet below is just an example of how this filter can be used. In the example below we’ll remove the link from the current breadcrumb item if we’re on a page.

// Removes the link of the last crumb if it's a page.
add_filter( 'aioseo_breadcrumbs_link_current_item', 'aioseo_breadcrumbs_link_current_item', 10 );
function aioseo_breadcrumbs_link_current_item( $linkCurrentItem ) {
	if ( is_singular( 'page' ) ) {
		$linkCurrentItem = false;
	}

	return $linkCurrentItem;
}