I’m trying to add a “settings” link to my plugin on the plugins page. I used this code, which I found on various sites and also in the documentation, but it simply doesn’t work (the link doesn’t show).

What did I do wrong?

function apd_settings_link( $links ) {
    $url           = get_admin_url() . "options-general.php?page=my-plugin";
    $settings_link = '<a href="' . $url . '">' . __('Settings', 'textdomain') . '</a>';
    array_unshift( $links, $settings_link );
    return $links;
}

add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'apd_settings_link');

Read more here: Adding settings link to plugin doesn’t work


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: