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

Follow-up to [13602], [13686], [14879], [25806], [28495], [32655], [48661], [53952].

Props yagniksangani, audrasjb, SergeyBiryukov.
Fixes #61124.
Built from https://develop.svn.wordpress.org/trunk@58082


git-svn-id: http://core.svn.wordpress.org/trunk@57547 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2024-05-02 17:20:10 +00:00
parent 18d2736d35
commit 137f90ef49
8 changed files with 135 additions and 8 deletions

View File

@ -23,10 +23,16 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
* The Plugin_Upgrader::bulk_upgrade() method will fill this in * The Plugin_Upgrader::bulk_upgrade() method will fill this in
* with info retrieved from the get_plugin_data() function. * with info retrieved from the get_plugin_data() function.
* *
* @since 3.0.0
* @var array Plugin data. Values will be empty if not supplied by the plugin. * @var array Plugin data. Values will be empty if not supplied by the plugin.
*/ */
public $plugin_info = array(); public $plugin_info = array();
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() { public function add_strings() {
parent::add_strings(); parent::add_strings();
/* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */ /* translators: 1: Plugin name, 2: Number of the plugin, 3: Total number of plugins being updated. */
@ -34,6 +40,10 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Performs an action before a bulk plugin update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function before( $title = '' ) { public function before( $title = '' ) {
@ -41,6 +51,10 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Performs an action following a bulk plugin update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function after( $title = '' ) { public function after( $title = '' ) {
@ -49,6 +63,9 @@ class Bulk_Plugin_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/ */
public function bulk_footer() { public function bulk_footer() {
parent::bulk_footer(); parent::bulk_footer();

View File

@ -24,10 +24,16 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
* with info retrieved from the Theme_Upgrader::theme_info() method, * with info retrieved from the Theme_Upgrader::theme_info() method,
* which in turn calls the wp_get_theme() function. * which in turn calls the wp_get_theme() function.
* *
* @since 3.0.0
* @var WP_Theme|false The theme's info object, or false. * @var WP_Theme|false The theme's info object, or false.
*/ */
public $theme_info = false; public $theme_info = false;
/**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/
public function add_strings() { public function add_strings() {
parent::add_strings(); parent::add_strings();
/* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */ /* translators: 1: Theme name, 2: Number of the theme, 3: Total number of themes being updated. */
@ -35,6 +41,10 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Performs an action before a bulk theme update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function before( $title = '' ) { public function before( $title = '' ) {
@ -42,6 +52,10 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Performs an action following a bulk theme update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function after( $title = '' ) { public function after( $title = '' ) {
@ -50,6 +64,9 @@ class Bulk_Theme_Upgrader_Skin extends Bulk_Upgrader_Skin {
} }
/** /**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/ */
public function bulk_footer() { public function bulk_footer() {
parent::bulk_footer(); parent::bulk_footer();

View File

@ -16,13 +16,30 @@
* @see WP_Upgrader_Skin * @see WP_Upgrader_Skin
*/ */
class Bulk_Upgrader_Skin extends WP_Upgrader_Skin { class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
public $in_loop = false;
/** /**
* Whether the bulk update process has started.
*
* @since 3.0.0
* @var bool
*/
public $in_loop = false;
/**
* Stores an error message about the update.
*
* @since 3.0.0
* @var string|false * @var string|false
*/ */
public $error = false; public $error = false;
/** /**
* Constructor.
*
* Sets up the generic skin for the Bulk Upgrader classes.
*
* @since 3.0.0
*
* @param array $args * @param array $args
*/ */
public function __construct( $args = array() ) { public function __construct( $args = array() ) {
@ -36,6 +53,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Sets up the strings used in the update process.
*
* @since 3.0.0
*/ */
public function add_strings() { public function add_strings() {
$this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' ); $this->upgrader->strings['skin_upgrade_start'] = __( 'The update process is starting. This process may take a while on some hosts, so please be patient.' );
@ -49,6 +69,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Displays a message about the update.
*
* @since 3.0.0
* @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support. * @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support.
* *
* @param string $feedback Message data. * @param string $feedback Message data.
@ -77,18 +100,27 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Displays the header before the update process.
*
* @since 3.0.0
*/ */
public function header() { public function header() {
// Nothing. This will be displayed within an iframe. // Nothing. This will be displayed within an iframe.
} }
/** /**
* Displays the footer following the update process.
*
* @since 3.0.0
*/ */
public function footer() { public function footer() {
// Nothing. This will be displayed within an iframe. // Nothing. This will be displayed within an iframe.
} }
/** /**
* Displays an error message about the update.
*
* @since 3.0.0
* @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
* *
* @param string|WP_Error $errors Errors. * @param string|WP_Error $errors Errors.
@ -113,18 +145,28 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Displays the header before the bulk update process.
*
* @since 3.0.0
*/ */
public function bulk_header() { public function bulk_header() {
$this->feedback( 'skin_upgrade_start' ); $this->feedback( 'skin_upgrade_start' );
} }
/** /**
* Displays the footer following the bulk update process.
*
* @since 3.0.0
*/ */
public function bulk_footer() { public function bulk_footer() {
$this->feedback( 'skin_upgrade_end' ); $this->feedback( 'skin_upgrade_end' );
} }
/** /**
* Performs an action before a bulk update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function before( $title = '' ) { public function before( $title = '' ) {
@ -137,6 +179,10 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Performs an action following a bulk update.
*
* @since 3.0.0
*
* @param string $title * @param string $title
*/ */
public function after( $title = '' ) { public function after( $title = '' ) {
@ -172,6 +218,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Resets the properties used in the update process.
*
* @since 3.0.0
*/ */
public function reset() { public function reset() {
$this->in_loop = false; $this->in_loop = false;
@ -179,6 +228,9 @@ class Bulk_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Flushes all output buffers.
*
* @since 3.0.0
*/ */
public function flush_output() { public function flush_output() {
wp_ob_end_flush_all(); wp_ob_end_flush_all();

View File

@ -22,6 +22,12 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
public $display_footer_actions = true; public $display_footer_actions = true;
/** /**
* Constructor.
*
* Sets up the language pack upgrader skin.
*
* @since 3.7.0
*
* @param array $args * @param array $args
*/ */
public function __construct( $args = array() ) { public function __construct( $args = array() ) {
@ -41,6 +47,9 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Performs an action before a language pack update.
*
* @since 3.7.0
*/ */
public function before() { public function before() {
$name = $this->upgrader->get_name_for_update( $this->language_update ); $name = $this->upgrader->get_name_for_update( $this->language_update );
@ -52,6 +61,9 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Displays an error message about the update.
*
* @since 3.7.0
* @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support. * @since 5.9.0 Renamed `$error` to `$errors` for PHP 8 named parameter support.
* *
* @param string|WP_Error $errors Errors. * @param string|WP_Error $errors Errors.
@ -63,12 +75,18 @@ class Language_Pack_Upgrader_Skin extends WP_Upgrader_Skin {
} }
/** /**
* Performs an action following a language pack update.
*
* @since 3.7.0
*/ */
public function after() { public function after() {
echo '</div>'; echo '</div>';
} }
/** /**
* Displays the footer following the bulk update process.
*
* @since 3.7.0
*/ */
public function bulk_footer() { public function bulk_footer() {
$this->decrement_update_count( 'translation' ); $this->decrement_update_count( 'translation' );

View File

@ -24,6 +24,12 @@ class Plugin_Installer_Skin extends WP_Upgrader_Skin {
private $is_downgrading = false; private $is_downgrading = false;
/** /**
* Constructor.
*
* Sets up the plugin installer skin.
*
* @since 2.8.0
*
* @param array $args * @param array $args
*/ */
public function __construct( $args = array() ) { public function __construct( $args = array() ) {

View File

@ -24,6 +24,12 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
private $is_downgrading = false; private $is_downgrading = false;
/** /**
* Constructor.
*
* Sets up the theme installer skin.
*
* @since 2.8.0
*
* @param array $args * @param array $args
*/ */
public function __construct( $args = array() ) { public function __construct( $args = array() ) {

View File

@ -20,7 +20,6 @@ class WP_Upgrader_Skin {
* Holds the upgrader data. * Holds the upgrader data.
* *
* @since 2.8.0 * @since 2.8.0
*
* @var WP_Upgrader * @var WP_Upgrader
*/ */
public $upgrader; public $upgrader;
@ -29,7 +28,6 @@ class WP_Upgrader_Skin {
* Whether header is done. * Whether header is done.
* *
* @since 2.8.0 * @since 2.8.0
*
* @var bool * @var bool
*/ */
public $done_header = false; public $done_header = false;
@ -38,7 +36,6 @@ class WP_Upgrader_Skin {
* Whether footer is done. * Whether footer is done.
* *
* @since 2.8.0 * @since 2.8.0
*
* @var bool * @var bool
*/ */
public $done_footer = false; public $done_footer = false;
@ -47,7 +44,6 @@ class WP_Upgrader_Skin {
* Holds the result of an upgrade. * Holds the result of an upgrade.
* *
* @since 2.8.0 * @since 2.8.0
*
* @var string|bool|WP_Error * @var string|bool|WP_Error
*/ */
public $result = false; public $result = false;
@ -56,7 +52,6 @@ class WP_Upgrader_Skin {
* Holds the options of an upgrade. * Holds the options of an upgrade.
* *
* @since 2.8.0 * @since 2.8.0
*
* @var array * @var array
*/ */
public $options = array(); public $options = array();
@ -82,6 +77,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Sets the relationship between the skin being used and the upgrader.
*
* @since 2.8.0 * @since 2.8.0
* *
* @param WP_Upgrader $upgrader * @param WP_Upgrader $upgrader
@ -94,6 +91,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Sets up the strings used in the update process.
*
* @since 3.0.0 * @since 3.0.0
*/ */
public function add_strings() { public function add_strings() {
@ -141,6 +140,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Displays the header before the update process.
*
* @since 2.8.0 * @since 2.8.0
*/ */
public function header() { public function header() {
@ -153,6 +154,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Displays the footer following the update process.
*
* @since 2.8.0 * @since 2.8.0
*/ */
public function footer() { public function footer() {
@ -164,6 +167,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Displays an error message about the update.
*
* @since 2.8.0 * @since 2.8.0
* *
* @param string|WP_Error $errors Errors. * @param string|WP_Error $errors Errors.
@ -186,6 +191,8 @@ class WP_Upgrader_Skin {
} }
/** /**
* Displays a message about the update.
*
* @since 2.8.0 * @since 2.8.0
* @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support. * @since 5.9.0 Renamed `$string` (a PHP reserved keyword) to `$feedback` for PHP 8 named parameter support.
* *
@ -218,7 +225,7 @@ class WP_Upgrader_Skin {
public function before() {} public function before() {}
/** /**
* Performs and action following an update. * Performs an action following an update.
* *
* @since 2.8.0 * @since 2.8.0
*/ */
@ -262,11 +269,15 @@ class WP_Upgrader_Skin {
} }
/** /**
* Displays the header before the bulk update process.
*
* @since 3.0.0 * @since 3.0.0
*/ */
public function bulk_header() {} public function bulk_header() {}
/** /**
* Displays the footer following the bulk update process.
*
* @since 3.0.0 * @since 3.0.0
*/ */
public function bulk_footer() {} public function bulk_footer() {}

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.6-alpha-58081'; $wp_version = '6.6-alpha-58082';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.