- Create a new file in your plugin directory, and name it something like "my-plugin.php".
- Add the following code to your newly created file:
<?php
/*
Plugin Name: My Custom Plugin
Description: This is my custom plugin.
Version: 1.0
*/
function my_custom_plugin_action_links( $actions, $plugin_file ) {
static $plugin;
if (!isset($plugin))
$plugin = plugin_basename(__FILE__);
if ($plugin == $plugin_file) {
$settings = array('settings' => '<a href="options-general.php?page=my-plugin-settings">Settings</a>');
$actions = array_merge($settings, $actions);
}
return $actions;
}
add_filter('plugin_action_links', 'my_custom_plugin_action_links', 10, 5);
?>
- Save the file and upload it to the wp-content/plugins directory in your WordPress installation.
- Activate the plugin in the WordPress admin dashboard.
- After activation, you should see a "Settings" link next to your custom plugin on the Plugins page.