PHP 클래스 EDD_SL_Plugin_Updater, Give

저자: Pippin Williamson
파일 보기 프로젝트 열기: wordimpress/give 1 사용 예제들

공개 메소드들

메소드 설명
__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