Take the 2-minute tour ×
WordPress Development Stack Exchange 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 2

up vote 6 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
4  
"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 '13 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 '13 at 8:42
    
Tough to answer that. It's been a long time. The main difference is {$prefix} but it seems the author of the question has answered that. It removes the warning from wordpress in debug mode and makes the program work even if $prefix is changed to something else other than ''. You have to understand that this hook isn't a part of the official wordpress api so it's best to hook into it the same way native wordpress code does so your code won't have issues in the future. –  mAsT3RpEE Nov 2 '13 at 21:20

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.