Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@fxbenard
Forked from benhuson/my_plugin_row_meta.php
Last active August 29, 2015 14:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fxbenard/2d62ff92be49ced13f41 to your computer and use it in GitHub Desktop.
Save fxbenard/2d62ff92be49ced13f41 to your computer and use it in GitHub Desktop.
<?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