Filter hook 'plugin_action_links_{$plugin_file}'

in WP Core File wp-admin/includes/class-wp-plugins-list-table.php at line 1080

View Source

plugin_action_links_{$plugin_file}

Filter Hook
Description
Filters the list of action links displayed for a specific plugin in the Plugins list table. The dynamic portion of the hook name, `$plugin_file`, refers to the path to the plugin file, relative to the plugins directory.

Hook Information

File Location wp-admin/includes/class-wp-plugins-list-table.php View on GitHub
Hook Type Filter
Line Number 1080

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_{$plugin_file}
add_filter('plugin_action_links_{$plugin_file}', '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:1080 - How this hook is used in WordPress core
<?php
1075  			 *                              of possible values.
1076  			 * @param string   $context     The plugin context. By default this can include 'all',
1077  			 *                              'active', 'inactive', 'recently_activated', 'upgrade',
1078  			 *                              'mustuse', 'dropins', and 'search'.
1079  			 */
1080  			$actions = apply_filters( "plugin_action_links_{$plugin_file}", $actions, $plugin_file, $plugin_data, $context );
1081  
1082  		}
1083  
1084  		$class       = $is_active ? 'active' : 'inactive';
1085  		$checkbox_id = 'checkbox_' . md5( $plugin_file );

PHP Documentation

<?php
/**
			 * Filters the list of action links displayed for a specific plugin in the Plugins list table.
			 *
			 * The dynamic portion of the hook name, `$plugin_file`, refers to the path
			 * to the plugin file, relative to the plugins directory.
			 *
			 * @since 2.7.0
			 * @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.