plugin_action_links
Filter HookDescription
Filters the action links displayed for each plugin in the Plugins list table.Hook Information
File Location |
wp-admin/includes/class-wp-plugins-list-table.php
View on GitHub
|
Hook Type | Filter |
Line Number | 1058 |
Hook Parameters
Type | Name | Description |
---|---|---|
string[]
|
$actions
|
An array of plugin action links. By default this can include 'activate', 'deactivate', and 'delete'. With Multisite active this can also include 'network_active' and 'network_only' items. |
string
|
$plugin_file
|
Path to the plugin file relative to the plugins directory. |
array
|
$plugin_data
|
An array of plugin data. See get_plugin_data() and the {@see 'plugin_row_meta'} filter for the list of possible values. |
string
|
$context
|
The plugin context. By default this can include 'all', 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', and 'search'. |
Usage Examples
Basic Usage
<?php
// Hook into plugin_action_links
add_filter('plugin_action_links', 'my_custom_filter', 10, 4);
function my_custom_filter($actions, $plugin_file, $plugin_data, $context) {
// Your custom filtering logic here
return $actions;
}
Source Code Context
wp-admin/includes/class-wp-plugins-list-table.php:1058
- How this hook is used in WordPress core
<?php
1053 * of possible values.
1054 * @param string $context The plugin context. By default this can include 'all',
1055 * 'active', 'inactive', 'recently_activated', 'upgrade',
1056 * 'mustuse', 'dropins', and 'search'.
1057 */
1058 $actions = apply_filters( 'plugin_action_links', $actions, $plugin_file, $plugin_data, $context );
1059
1060 /**
1061 * Filters the list of action links displayed for a specific plugin in the Plugins list table.
1062 *
1063 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
PHP Documentation
<?php
/**
* Filters the action links displayed for each plugin in the Plugins list table.
*
* @since 2.5.0
* @since 2.6.0 The `$context` parameter was added.
* @since 4.9.0 The 'Edit' link was removed from the list of action links.
*
* @param string[] $actions An array of plugin action links. By default this can include
* 'activate', 'deactivate', and 'delete'. With Multisite active
* this can also include 'network_active' and 'network_only' items.
* @param string $plugin_file Path to the plugin file relative to the plugins directory.
* @param array $plugin_data An array of plugin data. See get_plugin_data()
* and the {@see 'plugin_row_meta'} filter for the list
* of possible values.
* @param string $context The plugin context. By default this can include 'all',
* 'active', 'inactive', 'recently_activated', 'upgrade',
* 'mustuse', 'dropins', and 'search'.
*/
Quick Info
- Hook Type: Filter
- Parameters: 4
- File: wp-admin/includes/class-wp-plugins-list-table.php
Related Hooks
Related hooks will be displayed here in future updates.