Add last updated column to plugins list page

Home » Snippets » Add last updated column to plugins list page
0

Created with:

Visibility: 

public

Creator: Ahrale

Customize with WPTurbo AI
X

Add Snippet To Project

New Project
Add To Existing Project
					<?php

// Add last updated column to plugins list page
add_filter( 'manage_plugins_columns', 'atar4u_add_last_updated_column' );
add_action( 'manage_plugins_custom_column', 'atar4u_display_last_updated_column', 10, 3 );

function atar4u_add_last_updated_column( $columns ) {
    $columns['last_updated'] = __( 'Last Updated', 'wpturbo' );
    return $columns;
}

function wpturbo_display_last_updated_column( $column_name, $plugin_file, $plugin_data ) {
    if ( 'last_updated' === $column_name ) {
        $last_updated = strtotime( $plugin_data['Last Updated'] );
        echo esc_html( human_time_diff( $last_updated ) . ' ago' );
    }
}
				

Adds a column to plugins list, so you can know when the plugin was updated last time

Register an account to save your snippets or go Pro to get more features.