From d99cec0a570ade2af573f5606700ba59de47eee8 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Tue, 4 Aug 2009 21:52:31 +0000 Subject: [PATCH] Move plugin update notice output to the plugin specific hook so as to make them easier to filter and manage from plugins that want to do there own thing. Fixes #10464 props strider72. git-svn-id: https://develop.svn.wordpress.org/trunk@11775 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/update.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/update.php b/wp-admin/includes/update.php index 0db0882c6a..abb64c1c37 100644 --- a/wp-admin/includes/update.php +++ b/wp-admin/includes/update.php @@ -145,6 +145,15 @@ function update_right_now_message() { echo "$msg"; } +function wp_plugin_update_rows() { + $plugins = get_transient( 'update_plugins' ); + $plugins = array_keys( $plugins->response ); + foreach( $plugins as $plugin_file ) { + add_action( "after_plugin_row_$plugin_file", 'wp_plugin_update_row', 10, 2 ); + } +} +add_action( 'admin_init', 'wp_plugin_update_rows' ); + function wp_plugin_update_row( $file, $plugin_data ) { $current = get_transient( 'update_plugins' ); if ( !isset( $current->response[ $file ] ) ) @@ -169,7 +178,6 @@ function wp_plugin_update_row( $file, $plugin_data ) { echo ''; } -add_action( 'after_plugin_row', 'wp_plugin_update_row', 10, 2 ); function wp_update_plugin($plugin, $feedback = '') {