Skip to content

Instantly share code, notes, and snippets.

@benhuson
Created May 1, 2014 17:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benhuson/f31961daf0700423096c to your computer and use it in GitHub Desktop.
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.
<?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 );
?>
@fxbenard
Copy link

fxbenard commented May 2, 2014

Thanks, I forked it I made a few adjustments

  • Add you as the author
  • Add titles attributes
  • Remove some textdomains

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment