From ae65f096b07c193ed64aa73bad12723f29bbad7d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 28 Jul 2020 11:55:19 +0000 Subject: [PATCH] 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 --- .../includes/class-plugin-installer-skin.php | 6 +++ .../includes/class-plugin-upgrader-skin.php | 40 +++++++++++++-- .../includes/class-theme-installer-skin.php | 6 +++ .../includes/class-theme-upgrader-skin.php | 20 +++++++- .../includes/class-wp-ajax-upgrader-skin.php | 9 +++- .../includes/class-wp-upgrader-skin.php | 49 ++++++++++++++++++- 6 files changed, 123 insertions(+), 7 deletions(-) diff --git a/src/wp-admin/includes/class-plugin-installer-skin.php b/src/wp-admin/includes/class-plugin-installer-skin.php index 23af7d23d7..b8cf4b41db 100644 --- a/src/wp-admin/includes/class-plugin-installer-skin.php +++ b/src/wp-admin/includes/class-plugin-installer-skin.php @@ -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. diff --git a/src/wp-admin/includes/class-plugin-upgrader-skin.php b/src/wp-admin/includes/class-plugin-upgrader-skin.php index f4a119b754..6b911bfea2 100644 --- a/src/wp-admin/includes/class-plugin-upgrader-skin.php +++ b/src/wp-admin/includes/class-plugin-upgrader-skin.php @@ -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(); diff --git a/src/wp-admin/includes/class-theme-installer-skin.php b/src/wp-admin/includes/class-theme-installer-skin.php index be4fbd7b9b..76d2030f6d 100644 --- a/src/wp-admin/includes/class-theme-installer-skin.php +++ b/src/wp-admin/includes/class-theme-installer-skin.php @@ -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() ) { diff --git a/src/wp-admin/includes/class-theme-upgrader-skin.php b/src/wp-admin/includes/class-theme-upgrader-skin.php index 28df86fa26..7ca0b70db9 100644 --- a/src/wp-admin/includes/class-theme-upgrader-skin.php +++ b/src/wp-admin/includes/class-theme-upgrader-skin.php @@ -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' ); diff --git a/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php b/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php index 8acc9bf7f7..cd4175cd47 100644 --- a/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php +++ b/src/wp-admin/includes/class-wp-ajax-upgrader-skin.php @@ -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 ); diff --git a/src/wp-admin/includes/class-wp-upgrader-skin.php b/src/wp-admin/includes/class-wp-upgrader-skin.php index b88fbadc66..6151004eab 100644 --- a/src/wp-admin/includes/class-wp-upgrader-skin.php +++ b/src/wp-admin/includes/class-wp-upgrader-skin.php @@ -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() {}