Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

http://adambrown.info/p/wp_hooks/hook/plugin_action_links_%7B$plugin_file%7D

Says the hook is deprecated. However, the {$prefix}plugin_action_hook_{$plugin_file} is not. I poked around the wp-admin/includes/class-wp-plugins-list-table.php file for the hook, and found this:

$actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );

$prefix is defined a few lines above:

$prefix = $screen->is_network ? 'network_admin_' : '';

Since I was able to get my add_filter call to plugin_actions_row_{$plugin_file} to work, I'm assuming the filter hook is still there. Well, sort of: the filter is still available as it's not a network admin screen. Correct? And one could use...

add_filter( 'network_admin_plugin_action_links_{$plugin_file}', 'do_something' )

...to put a link into the network's plugin screen?

share|improve this question

2 Answers

up vote 5 down vote accepted

Yes, both should work as expected:

"plugin_action_links_{$plugin_file}"

"network_admin_plugin_action_links_{$plugin_file}"

Note that I'm using " instead of '.

PS: The term is deprecated, not depreciated.

share|improve this answer
3  
"The term is deprecated, not depreciated" Phew, I thought the filter had lost value ;) – TheDeadMedic Jun 18 '11 at 11:06
Whoa, I've been misreading that one for a long time now. Thanks! – chrisguitarguy Jun 18 '11 at 13:30
+1 for the deprecated comment. Learned something new! – Dan Feb 15 at 19:38

This should be backward compatible and error free

"{$prefix}plugin_action_links_{$plugin_file}"
share|improve this answer
This answer would greatly increase in quality if you made it clear as to how it's different from the original answer. Also, what is $prefix? – Johannes Pille May 7 at 8:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.