improved structured data - patch9

This commit is contained in:
opportus 2016-07-25 00:38:59 +02:00
parent 11ff1d535a
commit 7f12356d6b
1 changed files with 3 additions and 2 deletions

View File

@ -210,11 +210,12 @@ class WC_Structured_Data {
* @param array $args From `woocommerce_breadcrumb` action hook
*/
public function generate_breadcrumb_data( $args ) {
if ( empty( $breadcrumb = $args['breadcrumb'] ) ) {
if ( empty( $args['breadcrumb'] ) ) {
return;
}
$position = 1;
$breadcrumb = $args['breadcrumb'];
$position = 1;
foreach ( $breadcrumb as $key => $value ) {
if ( ! empty( $value[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) {