PHP Класс EDD_SL_Plugin_Updater, Give

Автор: Pippin Williamson
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string $_api_url, string $_plugin_file, array $_api_data = null ) : void Class constructor.
check_update ( array $_transient_data ) : array Check for Updates at the defined API endpoint and modify the update array.
http_request_args ( array $args, string $url ) : object Disable SSL verification in order to prevent download update failures
init ( ) : void Set up WordPress filters to hook into WP's update process.
plugins_api_filter ( mixed $_data, string $_action = '', object $_args = null ) : object Updates information on the "View version x.x details" page with custom data.
show_changelog ( )
show_update_notification ( string $file, array $plugin ) show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!

Приватные методы

Метод Описание
api_request ( string $_action, array $_data ) : false | object Calls the API and, if successfull, returns the object delivered by the API.

Описание методов

__construct() публичный Метод

Class constructor.
public __construct ( string $_api_url, string $_plugin_file, array $_api_data = null ) : void
$_api_url string The URL pointing to the custom API endpoint.
$_plugin_file string Path to the plugin file.
$_api_data array Optional data to send with API calls.
Результат void

check_update() публичный Метод

This function dives into the update API just when WordPress creates its update array, then adds a custom API call and injects the custom plugin data retrieved from the API. It is reassembled from parts of the native WordPress plugin update code. See wp-includes/update.php line 121 for the original wp_update_plugins() function.
public check_update ( array $_transient_data ) : array
$_transient_data array Update array build by WordPress.
Результат array Modified update array with custom plugin data.

http_request_args() публичный Метод

Disable SSL verification in order to prevent download update failures
public http_request_args ( array $args, string $url ) : object
$args array
$url string
Результат object $array

init() публичный Метод

Set up WordPress filters to hook into WP's update process.
public init ( ) : void
Результат void

plugins_api_filter() публичный Метод

Updates information on the "View version x.x details" page with custom data.
public plugins_api_filter ( mixed $_data, string $_action = '', object $_args = null ) : object
$_data mixed
$_action string
$_args object
Результат object $_data

show_changelog() публичный Метод

public show_changelog ( )

show_update_notification() публичный Метод

show update nofication row -- needed for multisite subsites, because WP won't tell you otherwise!
public show_update_notification ( string $file, array $plugin )
$file string
$plugin array