So, I would like to write a plugin that will pull the donate link out of readme.txt, and then display it in on the Manage Plugins page, in the list of plugin meta information (Version, Author, Plugin URL) as follows:
Here's the current plugin_meta array code from plugins.php:The lorem ipsum plugin Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam ac urna leo. Quisque ligula neque, vulputate ac suscipit adipiscing, lacinia non nisl. Morbi facilisis porta eros, ac ornare diam pretium quis.
Version 1.0 | By Chip Bennett | Visit plugin site | Donate
Two initial questions:Code:$plugin_meta = array(); if ( !empty($plugin_data['Version']) ) $plugin_meta[] = sprintf(__('Version %s'), $plugin_data['Version']); if ( !empty($plugin_data['Author']) ) { $author = $plugin_data['Author']; if ( !empty($plugin_data['AuthorURI']) ) $author = '<a href="' . $plugin_data['AuthorURI'] . '" title="' . __( 'Visit author homepage' ) . '">' . $plugin_data['Author'] . '</a>'; $plugin_meta[] = sprintf( __('By %s'), $author ); } if ( ! empty($plugin_data['PluginURI']) ) $plugin_meta[] = '<a href="' . $plugin_data['PluginURI'] . '" title="' . __( 'Visit plugin site' ) . '">' . __('Visit plugin site') . '</a>'; $plugin_meta = apply_filters('plugin_row_meta', $plugin_meta, $plugin_file, $plugin_data, $context); echo implode(' | ', $plugin_meta);
1) Does information in readme.txt (specifically, "Donate URI") get added to the $plugin array, such that the Donate URI would be $plugin['DonateURI'], like Author URI is $plugin['AuthorURI'] (but that comes from the plugin's php file rather than the readme.txt)?
2) How do I modify the above function, to add in the code to output the Donate link? I assume I have to use a function callback, but I've never done so, and the only time I tried, it failed miserably. :)


LinkBack URL
About LinkBacks



Reply With Quote
