Using WordPress ‘manage_plugins_custom_column’ PHP action

The manage_plugins_custom_column WordPress PHP action allows you to add custom content to each column of the Plugins list table.

Usage

add_action('manage_plugins_custom_column', 'your_custom_function', 10, 3);

function your_custom_function($column_name, $plugin_file, $plugin_data) {
    // your custom code here
    return $column_name;
}

Parameters

  • $column_name (string) – Name of the column.
  • $plugin_file (string) – Path to the plugin file relative to the plugins directory.
  • $plugin_data (array) – An array of plugin data. See get_plugin_data() and the ‘plugin_row_meta’ filter for the list of possible values.

More information

See WordPress Developer Resources: manage_plugins_custom_column

Examples

Add a custom field to plugin row

This example adds a custom field called “Custom Field” to the plugin row in the Plugins list table.

add_action('manage_plugins_custom_column', 'add_custom_field_to_plugin_row', 10, 3);

function add_custom_field_to_plugin_row($column_name, $plugin_file, $plugin_data) {
    if ($column_name == 'custom_field') {
        echo "Custom Field Content";
    }
}

Display plugin version

Display the version number of the plugin in a column called “Version”.

add_action('manage_plugins_custom_column', 'display_plugin_version', 10, 3);

function display_plugin_version($column_name, $plugin_file, $plugin_data) {
    if ($column_name == 'version') {
        echo $plugin_data['Version'];
    }
}

Show plugin author in a new column

Display the plugin author in a new column called “Author”.

add_action('manage_plugins_custom_column', 'show_plugin_author', 10, 3);

function show_plugin_author($column_name, $plugin_file, $plugin_data) {
    if ($column_name == 'author') {
        echo $plugin_data['Author'];
    }
}

Add a “Settings” link to the plugin row for plugins that have a settings page.

add_action('manage_plugins_custom_column', 'add_settings_link_to_plugin_row', 10, 3);

function add_settings_link_to_plugin_row($column_name, $plugin_file, $plugin_data) {
    if ($column_name == 'settings_link') {
        if ($plugin_data['TextDomain'] == 'your-plugin-textdomain') {
            echo '<a href="options-general.php?page=your-plugin-settings">Settings</a>';
        }
    }
}

Display plugin update status

Show whether the plugin has an update available or not in a new column called “Update Status”.

add_action('manage_plugins_custom_column', 'display_plugin_update_status', 10, 3);

function display_plugin_update_status($column_name, $plugin_file, $plugin_data) {
    if ($column_name == 'update_status') {
        if (isset($plugin_data['update']) && $plugin_data['update']) {
            echo 'Update available';
        } else {
            echo 'Up to date';
        }
    }
}