Created
May 1, 2014 17:24
-
-
Save benhuson/f31961daf0700423096c to your computer and use it in GitHub Desktop.
Add a link to your GitHub repo and translation link to your WordPress plugin.
This file contains hidden or 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. | |
* 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="%s">%s</a>', __( 'http://github.com/benhuson/my-plugin', 'my-plugin' ), __( 'GitHub', 'my-plugin' ) ); | |
$plugin_meta[] = sprintf( '<a href="%s">%s</a>', __( 'https://www.transifex.com/projects/p/my-plugin/resource/my-plugin/', '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
Thanks, I forked it I made a few adjustments