From 32f63b12b7ee15dba51f9ba9b8297cabac1f6278 Mon Sep 17 00:00:00 2001 From: westi 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: http://svn.automattic.com/wordpress/trunk@11775 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 = '') {