woocommerce_get_product_schema

The WooCommerce woocommerce get product schema function.

Description

(string) woocommerce_get_product_schema(); 

Returns (string)


Usage

  1. if ( !function_exists( 'woocommerce_get_product_schema' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-deprecated-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_get_product_schema(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-deprecated-functions.php  
  1. function woocommerce_get_product_schema() { 
  2. wc_deprecated_function( 'woocommerce_get_product_schema', '3.0' ); 
  3.  
  4. global $product; 
  5.  
  6. $schema = "Product"; 
  7.  
  8. // Downloadable product schema handling 
  9. if ( $product->is_downloadable() ) { 
  10. switch ( $product->download_type ) { 
  11. case 'application' : 
  12. $schema = "SoftwareApplication"; 
  13. break; 
  14. case 'music' : 
  15. $schema = "MusicAlbum"; 
  16. break; 
  17. default : 
  18. $schema = "Product"; 
  19. break; 
  20.  
  21. return 'http://schema.org/' . $schema;