Sure:
I have created a shortcode [DownloadCounter] it returns download count of a package (in this case package ID “6730”)
function shortcode_download() {
$download_count = get_package_data(6730,'download_count');
return $download_count;
}
add_shortcode('DownloadCounter', 'shortcode_download');
I dont want to put manually package ID (6730), instead I would like it to (2 different things) :
1) Modify the function to automatically get package ID from the package shown on the current page.
2) Create another function to return the total downloads of the sum of all packages.
Regards