A Settings Link for Your WordPress Plugins
by Bandicoot Marketing on | Posted in Tutorials | 7 comments
If you are developing a WordPress plugin, one of the first things I would suggest is adding a “Settings” link directly on the plugins page. This makes it easier for users to quickly access the plugin’s options page without having to search through the admin menu.
It is pretty simple to do, and only takes a few lines of code.
Add the following to your plugin file, within a <php> tag:
// Add settings link on plugin page function your_plugin_settings_link($links) { $settings_link = '<a href="options-general.php?page=your_plugin.php">Settings</a>'; array_unshift($links, $settings_link); return $links; } $plugin = plugin_basename(__FILE__); add_filter("plugin_action_links_$plugin", 'your_plugin_settings_link' );
Be sure to change the your_plugin.php
to the actual filename of your plugin.
I needed to know how to do exactly this for my upcoming plugin release. Your code worked perfectly! Thank you so much!
Hey this is really useful, just wanted to say thanks – this has been added to our FreeLance plugin which we’ll be releasing (relatively) soon!
I never really thought about doing this since I’m quite comfortable with the admin menu. It makes things a lot quicker though especially if you frequently change the settings.
Thank you, it’s work perfectly for my plugins.
🙂
Yea, don’t forget the link to your plugin page. This is right… Thx for this and bye and good luck
it works..!
thankyou..
I did tried the codes and it really works. thank you for sharing this one.