Docs: Add missing documentation for various upgrade/install class properties and methods.

Props ramiy.
Fixes #42923.

git-svn-id: https://develop.svn.wordpress.org/trunk@48661 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2020-07-28 11:55:19 +00:00
parent deb78bdf1c
commit ae65f096b0
6 changed files with 123 additions and 7 deletions

View File

@ -46,6 +46,9 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform before installing a plugin.
*
* @since 2.8.0
*/
public function before() {
if ( ! empty( $this->api ) ) {
@ -78,6 +81,9 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform following a plugin install.
*
* @since 2.8.0
*/
public function after() {
// Check if the plugin can be overwritten and output the HTML.

View File

@ -16,12 +16,43 @@
* @see WP_Upgrader_Skin
*/
class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
public $plugin = '';
public $plugin_active = false;
/**
* Holds the plugin slug in the Plugin Directory.
*
* @since 2.8.0
*
* @var object
*/
public $plugin = '';
/**
* Whether the plugin is active.
*
* @since 2.8.0
*
* @var bool
*/
public $plugin_active = false;
/**
* Whether the plugin is active for the entire network.
*
* @since 2.8.0
*
* @var bool
*/
public $plugin_network_active = false;
/**
* @param array $args
* Constructor.
*
* Sets up the plugin upgrader skin.
*
* @since 2.8.0
*
* @param array $args Optional. The plugin upgrader skin arguments to
* override default options. Default empty array.
*/
public function __construct( $args = array() ) {
$defaults = array(
@ -41,6 +72,9 @@ class Plugin_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform following a single plugin update.
*
* @since 2.8.0
*/
public function after() {
$this->plugin = $this->upgrader->plugin_info();

View File

@ -46,6 +46,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform before installing a theme.
*
* @since 2.8.0
*/
public function before() {
if ( ! empty( $this->api ) ) {
@ -78,6 +81,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform following a single theme install.
*
* @since 2.8.0
*/
public function after() {
if ( $this->do_overwrite() ) {

View File

@ -16,10 +16,25 @@
* @see WP_Upgrader_Skin
*/
class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
/**
* Holds the theme slug in the Theme Directory.
*
* @since 2.8.0
*
* @var object
*/
public $theme = '';
/**
* @param array $args
* Constructor.
*
* Sets up the theme upgrader skin.
*
* @since 2.8.0
*
* @param array $args Optional. The theme upgrader skin arguments to
* override default options. Default empty array.
*/
public function __construct( $args = array() ) {
$defaults = array(
@ -36,6 +51,9 @@ class Theme_Upgrader_Skin extends WP_Upgrader_Skin {
}
/**
* Action to perform following a single theme update.
*
* @since 2.8.0
*/
public function after() {
$this->decrement_update_count( 'theme' );

View File

@ -22,6 +22,7 @@ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
* Holds the WP_Error object.
*
* @since 4.6.0
*
* @var null|WP_Error
*/
protected $errors = null;
@ -29,9 +30,15 @@ class WP_Ajax_Upgrader_Skin extends Automatic_Upgrader_Skin {
/**
* Constructor.
*
* Sets up the WordPress Ajax upgrader skin.
*
* @since 4.6.0
*
* @param array $args Options for the upgrader, see WP_Upgrader_Skin::__construct().
* @see WP_Upgrader_Skin::__construct()
*
* @param array $args Optional. The WordPress Ajax upgrader skin arguments to
* override default options. See WP_Upgrader_Skin::__construct().
* Default empty array.
*/
public function __construct( $args = array() ) {
parent::__construct( $args );

View File

@ -15,21 +15,60 @@
*/
class WP_Upgrader_Skin {
/**
* Holds the upgrader data.
*
* @since 2.8.0
*
* @var object
*/
public $upgrader;
/**
* Whether header is done.
*
* @since 2.8.0
*
* @var bool
*/
public $done_header = false;
/**
* Whether footer is done.
*
* @since 2.8.0
*
* @var bool
*/
public $done_footer = false;
/**
* Holds the result of an upgrade.
*
* @since 2.8.0
*
* @var string|bool|WP_Error
*/
public $result = false;
public $result = false;
/**
* Holds the options of an upgrade.
*
* @since 2.8.0
*
* @var array
*/
public $options = array();
/**
* @param array $args
* Constructor.
*
* Sets up the generic skin for the WordPress Upgrader classes.
*
* @since 2.8.0
*
* @param array $args Optional. The WordPress upgrader skin arguments to
* override default options. Default empty array.
*/
public function __construct( $args = array() ) {
$defaults = array(
@ -161,10 +200,16 @@ class WP_Upgrader_Skin {
}
/**
* Action to perform before an update.
*
* @since 2.8.0
*/
public function before() {}
/**
* Action to perform following an update.
*
* @since 2.8.0
*/
public function after() {}