Forked from wpscholar/wp-plugin-settings-link.php
Created
September 20, 2017 23:33
-
-
Save jimboobrien/a424fa2bf38f9b28942e54e07cbca144 to your computer and use it in GitHub Desktop.
Add a settings link to your WordPress plugin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add a settings link to your WordPress plugin on the plugin listing page. | |
*/ | |
function add_settings_link( $links, $file ){ | |
if( $file == plugin_basename(__FILE__) ){ | |
$settings_link = '<a href="'.admin_url('admin.php?page=my-page').'">'.__('Settings', $this->textdomain).'</a>'; | |
array_unshift( $links, $settings_link ); | |
} | |
return $links; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment