Skip to content

Instantly share code, notes, and snippets.

@JeroenSormani
Created June 19, 2015 06:26
Display the total download count
<?php
add_shortcode( 'total_downloads', function() {
$downloaded = wp_list_pluck( get_option( 'worg_plugin_request', array() ), 'downloaded' );
$downloads = array_sum( $downloaded );
return '<span class="total-downloads">' . number_format( absint( $downloads ) ) . '</span>';
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment