mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
https://www.businessbloomer.com/woocommerce-fix-google-search-console-no-global-identifier-provided/
6 lines
224 B
Text
6 lines
224 B
Text
add_filter( 'woocommerce_structured_data_product', 'wc_set_gtin_from_sku', 9999, 2 );
|
|
|
|
function wc_set_gtin_from_sku( $markup, $product ) {
|
|
$markup['gtin8'] = str_replace( '-', '', $markup['sku'] );
|
|
return $markup;
|
|
}
|