Forked from nicomollet/woocommerce_structured_data_product_brand.php
Created
September 10, 2019 14:14
-
-
Save ulziibat-n/ece382704845d4b18987a406c22048a7 to your computer and use it in GitHub Desktop.
WooCommerce: Adds Brand attribute to "Product" Structured Data
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* WooCommerce: Adds Brand attribute to "Product" Structured Data | |
* | |
* @param array $data | |
* | |
* @return array | |
*/ | |
function woocommerce_structured_data_product_brand ($data) { | |
global $product; | |
$data['brand'] = 'Custom Brand' ?? null; | |
return $data; | |
} | |
add_filter( 'woocommerce_structured_data_product', 'woocommerce_structured_data_product_brand' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment