-
-
Save fxbenard/2d62ff92be49ced13f41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Row Meta | |
* | |
* Adds GitHub and translate links below the plugin description on the plugins page. | |
* Author: benhuson, tweaked by fxbenard for WP-Translations | |
* Replace references to 'my-plugin' to reflect your plugin folder and file name. | |
* Update the GitHub Repo and Translation links. | |
* | |
* @param array $plugin_meta Plugin meta display array. | |
* @param string $plugin_file Plugin reference. | |
* @param array $plugin_data Plugin data. | |
* @param string $status Plugin status. | |
* @return array Plugin meta array. | |
*/ | |
function my_plugin_row_meta( $plugin_meta, $plugin_file, $plugin_data, $status ) { | |
if ( 'my-plugin/my-plugin.php' == $plugin_file ) { | |
$plugin_meta[] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', 'http://github.com/benhuson/my-plugin', __( 'Visit the GitHub page', 'my-plugin' ), 'GitHub' ); | |
$plugin_meta[] = sprintf( '<a href="%1$s" title="%2$s">%3$s</a>', 'https://www.transifex.com/projects/p/my-plugin/', __( 'Join us on Transifex', 'my-plugin' ), __( 'Translate', 'my-plugin' ) ); | |
} | |
return $plugin_meta; | |
} | |
add_filter( 'plugin_row_meta', 'my_plugin_row_meta', 10, 4 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment