Last active
April 13, 2023 16:48
-
-
Save danieliser/82a27623bc3f707e8d09 to your computer and use it in GitHub Desktop.
Fetch Active Install Count from WordPress Plugins API
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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