LLMS_Helper_Upgrader::plugins_api( bool $response, string $action = '', obj $args = null )
Filter API calls to get plugin information and replace it with data from LifterLMS.com API for our addons
Parameters Parameters
- $response
-
(bool) (Required) False (denotes API call should be made to wp.org for plugin info).
- $action
-
(string) (Optional) Name of the API action.
Default value: ''
- $args
-
(obj) (Optional) Additional API call args.
Default value: null
Return Return
(false|obj)
Source Source
File: libraries/lifterlms-helper/includes/class-llms-helper-upgrader.php
public function plugins_api( $response, $action = '', $args = null ) { if ( 'plugin_information' !== $action ) { return $response; } if ( empty( $args->slug ) ) { return $response; } $core = false; if ( 'lifterlms' === $args->slug ) { remove_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 ); $args->slug = 'lifterlms-com-lifterlms'; $core = true; } if ( 0 !== strpos( $args->slug, 'lifterlms-com-' ) ) { return $response; } $response = $this->set_plugins_api( $args->slug, true ); if ( $core ) { add_filter( 'plugins_api', array( $this, 'plugins_api' ), 10, 3 ); } return $response; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.0.0 | Introduced. |