Skip to content

Instantly share code, notes, and snippets.

@zanematthew
Last active August 29, 2015 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zanematthew/1fbc8a3d9742118e603b to your computer and use it in GitHub Desktop.
Save zanematthew/1fbc8a3d9742118e603b to your computer and use it in GitHub Desktop.
Plugin Action Links
<?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