Last active
August 29, 2015 14:11
-
-
Save zanematthew/1fbc8a3d9742118e603b to your computer and use it in GitHub Desktop.
Plugin Action Links
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
<?php | |
/** | |
* Add our links to the plugin page, these show under the plugin in the table view. | |
* | |
* @param $links(array) The links coming in as an array | |
* @param $current_plugin_file(string) This is the "plugin basename", i.e., my-plugin/plugin.php | |
*/ | |
function my_plugin_action_links( $links, $current_plugin_file ){ | |
if ( $current_plugin_file == 'my-plugin/plugin.php' ){ | |
$links['some_link'] = '<a href="' . admin_url( 'options-general.php?page=some-page' ) . '">' . esc_attr__( 'General Settings', 'text_domain' ) . '</a>'; | |
} | |
return $links; | |
} | |
add_filter( 'plugin_action_links', 'my_plugin_action_links' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment