pmpro_plugins_api

Setup plugin updaters.

Description

pmpro_plugins_api( $api, (string) $action = '', (constant) $args = null ); 

Parameters (3)

0. $api
The api.
1. $action — Optional. (string) => ''
The action.
2. $args — Optional. (constant) => null
The args.

Usage

  1. if ( !function_exists( 'pmpro_plugins_api' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/includes/addons.php'; 
  3.  
  4. // The api. 
  5. $api = null; 
  6.  
  7. // The action. 
  8. $action = ''; 
  9.  
  10. // The args. 
  11. $args = null; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = pmpro_plugins_api($api, $action, $args); 
  15.  

Defined (1)

The function is defined in the following location(s).

/includes/addons.php  
  1. function pmpro_plugins_api($api, $action = '', $args = null) 
  2. {  
  3. //Not even looking for plugin information? Or not given slug? 
  4. if('plugin_information' != $action || empty($args->slug)) 
  5. return $api; 
  6.  
  7. //getaddoninformation 
  8. $addon = pmpro_getAddonBySlug($args->slug); 
  9.  
  10. //no addons? 
  11. if(empty($addon)) 
  12. return $api; 
  13.  
  14. //handled by wordpress.org? 
  15. if(empty($addon['License']) || $addon['License'] == 'wordpress') 
  16. return $api; 
  17.  
  18. // Create a new stdClass object and populate it with our plugin information. 
  19. return $api;