Hello developer, hope you are doing well. In this tutorial i am going to discuss about how to create WordPress add settings link to plugin page. If you are a plugin developer then you will know that sometimes we need to create plugin settings page.
From plugin settings page a user can change plugin options and use that plugin as they want. So in this tutorial we will make a simple WordPress plugin to show you how to create a custom WordPress plugin settings page.
If you are going to create your own WordPress plugin and you don't know how to add a plugin settings page in your plugin, then this tutorial is for you. We don't need WordPress plugin settings page generator, we will create it with just simple bit line of code.
Preview:
Now let's start. Just paste this below code to your plugin page and see this settings page will be added.
If you need your plugin menu also, then you can add this hook in your plugins file. Then you will get your plugin menu in admin panel.
//Customize your plugin page from here
function codechief_custom_plugin_page()
{
add_options_page('Page Title', 'CodeChief', 'manage_options', 'codechief', 'options_page');
}
add_action('admin_menu', 'codechief_custom_plugin_page');
function options_page()
{
echo "Hello devs";
}
Then you will see it in your settings options like below.
Check also : How to Create an Advanced Theme Options Page in WordPress
Hope it can help you.
#wordpress #plugin-development