Skip to content

Instantly share code, notes, and snippets.

@lloc
Last active December 17, 2015 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save lloc/5685045 to your computer and use it in GitHub Desktop.
Save lloc/5685045 to your computer and use it in GitHub Desktop.
WordPress - Add link to plugin_action_links
<?php
define( 'PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
function my_plugin_action_links( $actions, $plugin_file, $plugin_data, $context ) {
if ( PLUGIN_BASENAME == $plugin_file )
$actions[] = '<a href="#">Test: plugin_action_links</a>';
return $actions;
}
add_filter( 'plugin_action_links', 'my_plugin_action_links', 10, 4 );
add_filter( 'network_admin_plugin_action_links', 'my_plugin_action_links', 10, 4 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment