Add column to plugins table screen

I’m trying to add a column to plugin table screen using “manage_plugins_custom_column”, but without success.

This extra column will show a custom value that was placed inside the plugin file.

Read More

I hope someone could help!

Thanks!
Daniel

—————- edit —————-

This is the working code that creates the column “Version”:

function add_plugins_column( $columns ) {
$columns = array(
"name" => __( 'Plugin', '' ),
"version" => __( 'Version', '' ),
"description" => __( 'Description', '' ),
);
return $columns;
} add_filter( 'manage_plugins_columns', 'add_plugins_column' );

function render_plugins_column( $column, $plugin_file, $plugin_data ) {
switch ($column) {
case "version": echo $plugin_data['Version']; break;
}
} add_action( 'manage_plugins_custom_column' , 'render_plugins_column', 10, 3 );

Related posts

Leave a Reply

1 comment

  1. First, you have to add the custom column to the plugin column names:

    function wpa65189_add_plugins_column( $columns ) {
        $columns['wpa65189_column'] = 'wpa65189 Custom Column';
        return $columns;
    }
    add_filter( 'manage_plugins_columns', 'wpa65189_add_plugins_column' );
    

    Then output your column data for your plugin:

    function wpa65189_render_plugins_column( $column_name, $plugin_file, $plugin_data ) {
        if ( 'wpa65189_column' == $column_name && 'My Plugin Name' == $plugin_data['Name'] ) :
            echo 'My Plugin custom column data';
        endif;
    }
    add_action( 'manage_plugins_custom_column' , 'wpa65189_render_plugins_column', 10, 3 );