Is there any way to determine what plugin the plugin_action_links filter is addressing when it processes the filter?
I’m trying to add some actions for each plugin on the /wp-admin/plugins.php
page. Code looks as so:
public function _add_plugin_links(){
$plugins = get_plugins();
foreach($plugins as $k=>$plugin){
add_filter( 'plugin_action_links_' . $k, array(&$this, '_plugin_action_links') );
} // foreach $plugins
}
public function _plugin_action_links( $links ) {
$plugin = 'test'; // Somehow get plugin name here?
$links[] = 'Plugin name is: '.$plugin;
return $links;
}
I am able to append this text to the end of each plugin link list, but cannot determine exactly which plugin I am adding the text to. Adding a global variable from within _add_plugin_links()
simply returns the very last plugin that is parsed from the plugins list.
There are currently four filters and they carry lots of information:
This is a var dump of the parameters for Advanced Custom Fields:
You could use the bare
plugin_actions_link
and detect the plugin file, but it’s easier with the second. Example adding an Action Link to ACF inwp-admin/network/plugins.php
:Another filter of interest:
plugin_row_meta
.