woocommerce_get_product_schema()
Deprecated since 3.0.0. It is no longer supported and may be removed in future releases. It is recommended to replace this function with the same one.
No Hooks.
Returns
String.
Usage
woocommerce_get_product_schema();
Notes
- See: WC_Structured_Data class
Changelog
| Deprecated since | 3.0.0 |
woocommerce_get_product_schema() woocommerce get product schema code WC 10.5.0
function woocommerce_get_product_schema() {
wc_deprecated_function( 'woocommerce_get_product_schema', '3.0' );
global $product;
$schema = "Product";
// Downloadable product schema handling
if ( $product->is_downloadable() ) {
switch ( $product->download_type ) {
case 'application' :
$schema = "SoftwareApplication";
break;
case 'music' :
$schema = "MusicAlbum";
break;
default :
$schema = "Product";
break;
}
}
return 'http://schema.org/' . $schema;
}