Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fetch Active Install Count from WordPress Plugins API
<?php
function get_plugin_install_count( $plugin ) {
$api = plugins_api( 'plugin_information', array(
'slug' => 'popup-maker',
'fields' => array( 'active_installs' => true )
) );
if( ! is_wp_error( $api ) ) {
return $api->active_installs;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment