目前有four filters 它们携带了大量信息:
$prefix = $screen->in_admin( \'network\' ) ? \'network_admin_\' : \'\';
$actions = apply_filters( $prefix . \'plugin_action_links\', array_filter( $actions ), $plugin_file, $plugin_data, $context );
$actions = apply_filters( $prefix . "plugin_action_links_$plugin_file", $actions, $plugin_file, $plugin_data, $context );
这是高级自定义字段参数的var转储:
Array
(
[0] => Array
(
[activate] => <a href="plugins.php?action=activate&plugin=advanced-custom-fields%2Facf.php&plugin_status=all&paged=1&s&_wpnonce=62d37299ca" title="Activate this plugin for all sites in this network" class="edit">Network Activate</a>
[edit] => <a href="plugin-editor.php?file=advanced-custom-fields/acf.php" title="Open this file in the Plugin Editor" class="edit">Edit</a>
[delete] => <a href="plugins.php?action=delete-selected&checked%5B0%5D=advanced-custom-fields%2Facf.php&plugin_status=all&paged=1&s&_wpnonce=b7f1cf2b36" title="Delete this plugin" class="delete">Delete</a>
)
[1] => advanced-custom-fields/acf.php
[2] => Array
(
[Name] => Advanced Custom Fields
[PluginURI] => http://www.advancedcustomfields.com/
[Version] => 4.2.2
[Description] => Fully customise WordPress edit screens with powerful fields. Boasting a professional interface and a powerfull API, it’s a must have for any web developer working with WordPress. Field types include: Wysiwyg, text, textarea, image, file, select, checkbox, page link, post object, date picker, color picker, repeater, flexible content, gallery and more!
[Author] => Elliot Condon
[AuthorURI] => http://www.elliotcondon.com/
[TextDomain] =>
[DomainPath] =>
[Network] =>
[Title] => Advanced Custom Fields
[AuthorName] => Elliot Condon
)
[3] => all
)
你可以用裸体的
plugin_actions_link
并检测插件文件,但第二个更容易。在中向ACF添加操作链接的示例
wp-admin/network/plugins.php
:
add_filter( \'network_admin_plugin_action_links_advanced-custom-fields/acf.php\', function( $actions, $plugin_file, $plugin_data, $context )
{
$actions[\'hello\'] = \'Hello worlds!\';
return $actions;
}, 10, 4 );
另一个感兴趣的过滤器:
plugin_row_meta
.