Make WordPress Core

Opened 12 years ago

Last modified 6 years ago

#22076 new enhancement

WP Upgrader: update_bulk_plugins_complete_actions and update_bulk_theme_complete_actions should pass information about all plugins/themes to the filter

Reported by: ragulka's profile ragulka Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Upgrade/Install Keywords: needs-patch
Focuses: Cc:

Description

In class-wp-upgrader.php, line 1214 there is this line:

$update_actions = apply_filters('update_plugin_complete_actions', $update_actions, $this->plugin);

When adding a filter to it like this:

add_filter('update_bulk_plugins_complete_actions','test_filter',99,2);

function test_filter( $update_actions, $plugins ) {
    echo print_r( $plugins, 1);
    return $update_actions;
}

Only the last updated plugin info will be printed. However, it should contain information about all the plugins that were updated (since we are dealing with a bulk upgrade here).

Change History (6)

#1 @ragulka
12 years ago

  • Summary changed from WP Upgrader: update_bulk_plugins_complete_actions should pass information about all plugins to the filter to WP Upgrader: update_bulk_plugins_complete_actions and update_bulk_theme_complete_actions should pass information about all plugins/themes to the filter

#2 @ragulka
12 years ago

  • Version changed from 3.4.2 to trunk

The same applies to update_bulk_theme_complete_actions

#3 @SergeyBiryukov
12 years ago

  • Version changed from trunk to 3.0

Confirmed. The actions were added in [14879] (for #11232).

#4 follow-up: @dd32
11 years ago

Suggestions for how to change this?

We can't just change the 2nd arg from the last plugin to an array of plugins, so I guess we'll probably have to add a 3rd arg for an array of plugins/themes.. not that the existing arg is exactly very useful..

#5 in reply to: ↑ 4 @ragulka
11 years ago

Replying to dd32:

Suggestions for how to change this?

We can't just change the 2nd arg from the last plugin to an array of plugins, so I guess we'll probably have to add a 3rd arg for an array of plugins/themes.. not that the existing arg is exactly very useful..

I agree that adding a 3rd argument makes most sense because it will keep backwards compatibility. Perhaps there are some kind of use cases for getting just the last upgraded plugin, so we can just keep this arg.

#6 @chriscct7
9 years ago

  • Type changed from defect (bug) to enhancement
Note: See TracTickets for help on using tickets.