Opened 15 years ago
Closed 15 years ago
#9553 closed enhancement (fixed)
Allow plugins to add info to the "new version" message
Reported by: | JohnLamansky | Owned by: | |
---|---|---|---|
Milestone: | 2.8 | Priority: | normal |
Severity: | normal | Version: | 2.7.1 |
Component: | Plugins | Keywords: | has-patch tested commit |
Focuses: | Cc: |
Description
This patch would allow plugins to insert content directly after the "There is a new version of (name) available" line in the plugin administration, via a new after_plugin_update_row action.
A plugin could hook into this to insert pre-upgrade reminders or instructions, for example. (e.g. for those plugins that store custom files needing to be backed up.) I also would find this new action useful for a plugin I'm developing.
I know it's possible to add another <tr></tr> row using the existing after_plugin_row action, but it would look cleaner to include all upgrade-related information in the same row.
Attachments (2)
Change History (8)
#3
@
15 years ago
- Milestone set to 2.8
- Resolution invalid deleted
- Status changed from closed to reopened
There's currently no way to add upgrade-related information directly into the same row as the "There is a new version of (plugin name) available" message.
As I stated in the ticket:
I know it's possible to add another <tr></tr> row using the existing after_plugin_row action, but it would look cleaner to include all upgrade-related information in the same row.
Here's a hypothetical usage example:
Plugin code:
function myplugin_update_reminder( $file ) { if ( 'my_file' == $file ) echo "\n\n<br />Remember to backup this plugin’s custom files <a href='(url)'>here</a> before upgrading."; } add_action( 'after_plugin_update_message', 'myplugin_update_reminder' );
Output example:
<tr><td colspan="5" class="plugin-update"> There is a new version of (plugin name) available. <a href="(url)" class="thickbox">View version 2.0 Details</a> or <a href="(url)">upgrade automatically</a>. <br />Remember to backup this plugin’s custom files <a href='(url)'>here</a> before upgrading. </td></tr>
seems invalid. you can already do more or less the same with existing hooks: on the plugin_row hook (or whatever it is), check if an update is suggested in the update_plugins option.