Tribe__PUE__Checker::inject_info( mixed $result, string $action = null, array|object $args = null )
Intercept plugins_api() calls that request information about our plugin and use the configured API endpoint to satisfy them.
Contents
See also
Parameters
- $result
-
(mixed) (Required) The result object or NULL.
- $action
-
(string) (Optional) The type of information being requested from the Plugin Install API.
Default value: null
- $args
-
(array|object) (Optional) Arguments used to query for installer pages from the Plugin Install API.
Default value: null
Return
(mixed)
Source
File: src/Tribe/PUE/Checker.php
public function inject_info( $result, $action = null, $args = null ) {
$relevant = ( 'plugin_information' === $action ) && isset( $args->slug ) && ( $args->slug === $this->slug );
if ( ! $relevant ) {
return $result;
}
$query_args = $this->get_validate_query();
$plugin_info = $this->license_key_status( $query_args );
if ( $plugin_info ) {
return $plugin_info->to_wp_format();
}
return $result;
}