Last active
December 11, 2015 15:08
-
-
Save aprakasa/4618624 to your computer and use it in GitHub Desktop.
Add Additional Links To The WordPress Plugin Admin
This file contains 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
add_filter('plugin_row_meta', 'register_plugins_links', 10, 2); | |
/** | |
* Add Additional Links To The WordPress Plugin Admin | |
* | |
* @see http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin | |
*/ | |
function register_plugins_links ($links, $file) { | |
$base = plugin_basename(__FILE__); | |
if ($file == $base) { | |
$links[] = '<a href="admin.php?page=settings_plugin">' . __('Settings') . '</a>'; | |
$links[] = '<a href="http://domain.com/FAQ/">' . __('FAQ') . '</a>'; | |
$links[] = '<a href="http://domain.com/contact-us">' . __('Support') . '</a>'; | |
$links[] = '<a href="https://plus.google.com/u/0/b/104753541785944238696/">' . __('Google Plus Page') . '</a>'; | |
} | |
return $links; | |
} | |
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), 'link_action_on_plugin' ); | |
/** | |
* add links to the left side menu on the plugin screen. | |
* | |
* @see http://www.paulund.co.uk/add-additional-links-to-the-wordpress-plugin-admin | |
*/ | |
function link_action_on_plugin( $links ) { | |
return array_merge( array( 'settings' => '<a href="' . admin_url( '/wp-admin/tools.php?page=the-plugin-settings-page.php' ) . '">' . __( 'Settings', 'domain' ) . '</a>'), $links); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment