Creating Additional WordPress Plugin Links Row Meta

By default, WordPress only display the author and plugin URI links. Since the version 2.8, they applied filter plugin_row_meta within the plugin administration section. With this filter, you can create many links for your plugin or another plain text.

You can see the filter changes log below:
2.8 wp-admin/plugins.php
2.9 wp-admin/plugins.php
3.0 wp-admin/plugins.php
3.1 wp-admin/includes/class-wp-plugins-list-table.php
3.2 wp-admin/includes/class-wp-plugins-list-table.php
3.3 wp-admin/includes/class-wp-plugins-list-table.php

Let’s start to create the additional links by using the filter. First, create function that returns the links in an array and then add the filter with your function.

Put this function in your main .php plugin file:

function my_plugin_links($links, $file) {
	$plugin = plugin_basename(__FILE__);

	if ($file == $plugin) // only for this plugin
		return array_merge( $links,
			array( sprintf( '%s', $plugin, __('Settings') ) ),
			array( '' . __('Link 1') . '' ),
			array( '' . __('Link 2') . '' ),
			array( '' . __('Link 3') . '' )
		);
	return $links;
}

add_filter( 'plugin_row_meta', 'my_plugin_links', 10, 2 );
This entry was posted in Tutorial and tagged , , , . Bookmark the permalink. 1049 Views

2 Responses to Creating Additional WordPress Plugin Links Row Meta

  1. [...] Excerpt from:  Creating Additional WordPress Plugin Links Row Meta | Zourbuth [...]

  2. [...] here to see the original: Creating Additional WordPress Plugin Links Row Meta | Zourbuth [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>