Skip to content

Instantly share code, notes, and snippets.

Created Dec 21, 2018
What would you like to do?
[WordPress] Adding a Plugin Settings Link
add_filter('plugin_action_links_' . plugin_basename(__FILE__), __NAMESPACE__ . '\\acme_settings_link' );
* Creates a Settings link that links the users directly to the Settings page from the admin
* screen.
* @param array $links The list of links to appear under the plugin title.
* @return array $links The updated array of links including the 'Settings' link.
function acme_settings_link($links) {
// Build the URL.
$url = add_query_arg(
get_admin_url() . 'admin.php'
// Create the link.
$settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>';
// Adds the link to the end of the array.
return $links;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment