This is the function shortcode to extract Edd Easy Digital Download Plugin sales field.
This Easy Digital Download shortcode will extract from the sales field and display in your page.
First, locate your shortcode.php file in your wordpress plugin folder. Go into easy digital download folder, go into includes folder. Find shortcodes.php
Input this function into shortcodes.php
After that, use this shortcode [edd_sales] into your post/page
[code]
function edd_download_sales_shortcode( $atts, $content = null ) {
extract( shortcode_atts( array(‘id’ => NULL,), $atts, ‘edd_sales’ ) );
$number_of_downloads = get_post_meta($id, ‘_edd_download_sales’, TRUE) ;
$number_of_downloads = empty( $number_of_downloads ) ? "0" : $number_of_downloads;
echo $number_of_downloads;
}
add_shortcode( ‘edd_sales’, ‘edd_download_sales_shortcode’ );
[/code]