edd_add_oembed_price

Adds Download product price to oembed display.

Description

edd_add_oembed_price(); 

Usage

  1. if ( !function_exists( 'edd_add_oembed_price' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'easy-digital-downloads/includes/template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = edd_add_oembed_price(); 
  7.  

Defined (1)

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

/includes/template-functions.php  
  1. function edd_add_oembed_price() { 
  2.  
  3. if( 'download' !== get_post_type( get_the_ID() ) ) { 
  4. return; 
  5.  
  6. $show = ! get_post_meta( get_the_ID(), '_edd_hide_purchase_link', true ); 
  7.  
  8. if ( apply_filters( 'edd_show_oembed_purchase_links', $show ) ) { 
  9. echo '<style>.wp-embed-edd-price { margin: 20px 0 0 0; }</style>'; 
  10. echo '<div class="wp-embed-edd-price">'; 
  11. if ( edd_has_variable_prices( get_the_ID() ) ) { 
  12. echo edd_price_range( get_the_ID() ); 
  13. } else { 
  14. edd_price( get_the_ID(), true ); 
  15.  
  16. echo '</div>';