plugin_updaterev

Ok So I wanted to tell everyone about how when an upgrade for a plugin is needed to create a box under the update to show custom update options from the developer. So this is how that happens:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/****************************
   Render update info on the plugins panel if the update is available.
****************************/
        function mp3_plugin_check_version($file, $plugin_data) {
            global $wp_version;
            static $this_plugin;
            $wp_version = str_replace(".","",$wp_version);
            if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
            if ($file == $this_plugin){
                $current = $wp_version < 28 ? get_option('update_plugins') : get_transient('update_plugins');
                if (!isset($current->response[$file])) return false;
 
                $columns =  $wp_version < 28 ? 5 : 3;
                $url = 'http://www.thomasnorberg.com/pluginversions.txt';
                $update = wp_remote_fopen($url);
                if ($update != "") {
                    echo '<tr class="plugin-update-tr"><td colspan="'.$columns.'" class="plugin-update"><div class="update-message">';
                    echo $update;
                    echo '</div></td></tr>';
                }
            }
        }
add_action('after_plugin_row', 'mp3_plugin_check_version', 10, 2);

http://www.thomasnorberg.com/pluginversions.txt This link here is just a file that I have on my server to help the update panel show up.



~~~~~Written by Tom -Visit Website~~~~~
~~~~~Subscribe to my RSS Feed.~~~~~

VN:F [1.9.3_1094]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.3_1094]
Rating: 0 (from 0 votes)