Adding Custom Link to Plugins page in WordPress

I had to search a lot for adding a custom link to WordPress Plugin page that linked to Settings page of my plugin. So here’s a Tutorial on how to add it.

There are two parts of adding Custom Links

Add the following lines to add a filter

add_filter('plugin_action_links',' xydac_settings', 10, 2);

Here xydac_setting refers to the function which is used to add links.

Add the function for handling the Filter

function xydac_settings($links, $file) {
static $this_plugin;
if (!$this_plugin) $this_plugin = plugin_basename(__FILE__);
if ($file == $this_plugin){
$my_link = "<a href="admin.php?page=ultimate-taxonomy-manager">" . __("Settings") . "</a>";
array_unshift($links, $my_link);
}
return $links;
}

Add the links to Settings file of your plugin in this function and assign it to variable $my_link.

Thats all you have to do to add the settings link to your Plugin.

.

Advertisements
  1. hello!This was a really superb post!
    I come from milan, I was luck to approach your website in yahoo
    Also I get a lot in your Topics really thank your very much i will come daily

  2. Thanks for the post. Was looking for this for plugin development

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: