Created
January 9, 2014 18:36
-
-
Save thefuxia/8339456 to your computer and use it in GitHub Desktop.
Show last modified date for plugins in plugin list.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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