Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#36875 closed defect (bug) (fixed)

upgrader_process_complete action is not documented well

Reported by: nextendweb Owned by: DrewAPicture
Priority: normal Milestone: 4.6
Component: Upgrade/Install Version: 3.7
Severity: normal Keywords:
Cc: Focuses: docs

Description

The comment for upgrader_process_complete action indices that the "packages" key will contain the updated packages, but in real for themes it is the "themes" key and for plugins the "plugins" key.

<?php
                /**
                 * Fires when the bulk upgrader process is complete.
                 *
                 * @since 3.6.0
                 *
                 * @param Plugin_Upgrader $this Plugin_Upgrader instance. In other contexts, $this, might
                 *                              be a Theme_Upgrader or Core_Upgrade instance.
                 * @param array           $data {
                 *     Array of bulk item update data.
                 *
                 *     @type string $action   Type of action. Default 'update'.
                 *     @type string $type     Type of update process. Accepts 'plugin', 'theme', or 'core'.
                 *     @type bool   $bulk     Whether the update process is a bulk update. Default true.
                 *     @type array  $packages Array of plugin, theme, or core packages to update.
                 * }
                 */
                do_action( 'upgrader_process_complete', $this, array(
                        'action' => 'update',
                        'type' => 'plugin',
                        'bulk' => true,
                        'plugins' => $plugins,
                ) );
<?php
                /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
                do_action( 'upgrader_process_complete', $this, array(
                        'action' => 'update',
                        'type' => 'theme',
                        'bulk' => true,
                        'themes' => $themes,
                ) );

Change History (4)

#1 @DrewAPicture
10 years ago

  • Milestone Awaiting Review → 4.6
  • Resolution → fixed
  • Status new → closed
  • Type enhancement → defect (bug)
  • Version 4.5.2 → 3.7

Missed this ticket. This was fixed in [37550].

#2 @DrewAPicture
10 years ago

  • Resolution fixed
  • Status closed → reopened

I see what you're getting at, e.g.

<?php
                /** This action is documented in wp-admin/includes/class-wp-upgrader.php */
                do_action( 'upgrader_process_complete', $this, array(
                        'action' => 'update',
                        'type' => 'theme',
                        'bulk' => true,
                        'themes' => $themes,
                ) );

etc.

#3 @DrewAPicture
10 years ago

  • Owner set to DrewAPicture
  • Resolution → fixed
  • Status reopened → closed

In 37558:

Docs: Update hook docs for the upgrader_package_options filter and upgrader_process_complete action to reflect expected values in the core, language pack, theme, and plugin contexts.

Props nextendweb for the initial patch.
See [37550]. Fixes #36875.

#4 @nextendweb
10 years ago

Thanks @DrewAPicture It seems fine now :)

Note: See TracTickets for help on using tickets.