Version 5.0.0 beta 9
This commit is contained in:
1 parent
214f649f1d
commit
56979f8ee8
202 files changed
+4403
-1123
No files matched your search
+14
-12
@@ -1852,28 +1852,30 @@ class Output
|
||||
|
||||
foreach( $this->breadcrumb as $breadcrumb )
|
||||
{
|
||||
$crumb = [
|
||||
'@type' => "ListItem",
|
||||
'position' => $position,
|
||||
'item' => [
|
||||
'name' => $breadcrumb[1],
|
||||
]
|
||||
];
|
||||
|
||||
if( $breadcrumb[0] )
|
||||
{
|
||||
$elements[] = array(
|
||||
'@type' => "ListItem",
|
||||
'position' => $position,
|
||||
'item' => array(
|
||||
'@id' => (string) $breadcrumb[0],
|
||||
'name' => $breadcrumb[1],
|
||||
)
|
||||
);
|
||||
|
||||
$position++;
|
||||
$crumb['item']['@id'] = (string) $breadcrumb[0];
|
||||
}
|
||||
|
||||
$elements[] = $crumb;
|
||||
$position++;
|
||||
}
|
||||
|
||||
if( count( $elements ) )
|
||||
{
|
||||
$jsonLd['breadcrumbs'] = array(
|
||||
$jsonLd['breadcrumbs'] = [
|
||||
'@context' => "https://schema.org",
|
||||
'@type' => "BreadcrumbList",
|
||||
'itemListElement' => $elements,
|
||||
);
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user