Most plugins just have some standard details shown just below the plugin description when you look at your listing found under Plugins > Installed … wouldn’t it be nice to add your own specific links to the default ones WordPress already display?

You can, and it really is quite easy. A standard hook call and a relatively straight forward callback function and you are all set … and without further ado (and because it really is quite simple) here is a working callback function you can use:

 * Plugin Row Meta
 * Add plugin row meta by merging array elements into the existing $links
 * array which will then add these elements to the end of the standard
 * plugin row meta details.
 * Also to note, this will not appear while the plugin is not active.
 * @package    WPFA_Sample_Widget
 * @since      0.5
 * @date       March 22, 2014
 * @internal   for use with `plugin_row_meta` hook
 * @param    $links
 * @param    $file
 * @uses       plugin_basename
 * @return array|null
function wpfa_add_plugin_row_meta( $links, $file ) {

	/** Get the plugin file name for reference */
	$plugin_file = plugin_basename( __FILE__ );

	/** Check if $plugin_file matches the passed $file name */
	if ( $file == $plugin_file ) {

		 * Using `array_merge` add elements to the `$link` array to be
		 * returned. Identifying the link elements in the array will make
		 * them clearer if the need arises to review the array entries.

		/** @var array $links - sample element linking to GitHub to share code */
		$links = array_merge( $links, array( 'fork_link' => '<a href="">' . __( 'Fork on Github', 'wpfa-sample' ) . '</a>' ) );
		/** @var array $links - sample element linking to my personal (Edward Caissie) Amazon wish list. Thanks in advance! */
		$links = array_merge( $links, array( 'wish_link' => '<a href="">' . __( 'Grant a wish?', 'bns-fc' ) . '</a>' ) );

		 * Separate entries were used for example purposes. A single call to
		 * the `array_merge` function would have worked as well where all of
		 * the new elements were added at the same time.

	} /** End if - plugin file name matched passed value */

	/** Return the `$link` array for use in the `plugin_row_meta hook` */
	return $links;

} /** End function - add plugin row meta */ 

Now you may have noticed some tell-tale signs this was taken from my favorite sample plugin “WPFA Sample Plugin” and you are more than welcome to simply download or fork a copy from GitHub here. At the time of this writing the plugin had just recently been updated to a better level of code practices as well as the addition of the method above (remember, all your code should be in the plugin’s class) and released as version 0.5.

For the purposes of this exercise I will write the hook call as though it was not within the class but making those changes are fairly straight forward as well and I would expect you can sort that our on your own (if not, feel free to contact me for more specifics).

add_filter( 'plugin_row_meta', 'wpfa_add_plugin_row_meta', 10, 2 );

Don’t forget we need the parameters value as two (2) are being passed into the callback function; and, the priority value is simply the default which should be used in this case.