Skip to content

Instantly share code, notes, and snippets.

@thefuxia
Created January 9, 2014 18:36
Show Gist options
  • Save thefuxia/8339456 to your computer and use it in GitHub Desktop.
Save thefuxia/8339456 to your computer and use it in GitHub Desktop.
Show last modified date for plugins in plugin list.
<?php
/**
* Plugin Name: T5 Plugin Modification Info
* Description: Show last modified date for plugins in plugin list.
*/
add_filter( 'plugin_row_meta', 't5_plugins_last_mod', 100, 2 );
/**
* Add en entry to the plugin description.
*
* @wp-hook plugin_row_meta
* @param array $meta
* @param string $file
* @return array
*/
function t5_plugins_last_mod( Array $meta, $file ) {
$path = WP_PLUGIN_DIR . '/' . $file;
$format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
if ( is_readable( $path ) )
$meta[] = "Last modified: " . date( $format, filemtime( $path ) );
else
$meta[] = "Could not read file time.";
return $meta;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment