Skip to content

Instantly share code, notes, and snippets.

@sebastianmoran-mainwp
Forked from danieliser/functions.php
Created March 5, 2019 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sebastianmoran-mainwp/d46013ba730209b9133303423b2a0ebf to your computer and use it in GitHub Desktop.
Save sebastianmoran-mainwp/d46013ba730209b9133303423b2a0ebf to your computer and use it in GitHub Desktop.
Fetch Active Install Count for MainWP Child plugin from WordPress Plugins API
<?php
function get_plugin_install_count( $plugin ) {
$api = plugins_api( 'plugin_information', array(
'slug' => 'mainwp-child',
'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