Abort generate_breadcrumblist_data is there are no crumbs
This commit is contained in:
parent
8cb1fa2aff
commit
d5205b97f8
|
@ -287,6 +287,10 @@ class WC_Structured_Data {
|
|||
public function generate_breadcrumblist_data( $breadcrumbs ) {
|
||||
$crumbs = $breadcrumbs->get_breadcrumb();
|
||||
|
||||
if ( empty( $crumbs ) || ! is_array( $crumbs ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$markup = array();
|
||||
$markup['@type'] = 'BreadcrumbList';
|
||||
$markup['itemListElement'] = array();
|
||||
|
|
Loading…
Reference in New Issue