Tidy data

This commit is contained in:
Mike Jolley 2019-03-04 12:47:24 +00:00
parent 60d8a10bcf
commit 6caa0fab61
1 changed files with 5 additions and 3 deletions

View File

@ -197,9 +197,11 @@ class WC_Structured_Data {
$permalink = get_permalink( $product->get_id() ); $permalink = get_permalink( $product->get_id() );
$markup = array( $markup = array(
'@type' => 'Product', '@type' => 'Product',
'@id' => $permalink . '#product', // Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist. '@id' => $permalink . '#product', // Append '#product' to differentiate between this @id and the @id generated for the Breadcrumblist.
'name' => $product->get_name(), 'name' => $product->get_name(),
'image' => wp_get_attachment_url( $product->get_image_id() ),
'description' => wp_strip_all_tags( do_shortcode( $product->get_short_description() ? $product->get_short_description() : $product->get_description() ) ),
); );
$markup['image'] = wp_get_attachment_url( $product->get_image_id() ); $markup['image'] = wp_get_attachment_url( $product->get_image_id() );