Created
August 23, 2011 16:46
-
-
Save adamharley/1165812 to your computer and use it in GitHub Desktop.
SVN revision in WP admin footer version
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 | |
function core_svn_update_footer( $msg = '' ) { | |
if ( !current_user_can('update_core') ) | |
return $msg; | |
$cur = get_preferred_from_update_core(); | |
if ( ! isset( $cur->response ) ) | |
$cur->response = ''; | |
if ( 'development' == $cur->response && file_exists( ABSPATH . '.svn' ) ) { | |
if ( file_exists( ABSPATH . '.svn/entries' ) && $svn = file( ABSPATH . '.svn/entries' ) ) | |
return sprintf( __( 'You are using a development version (r%1$d) under SVN. Cool!', 'foo' ), $svn[3] ); | |
else | |
return sprintf( __( 'You are using a development version (%1$s) under SVN. Cool!', 'foo' ), $GLOBALS['wp_version'] ); | |
} | |
else | |
return $msg; | |
} | |
add_filter( 'update_footer', 'core_svn_update_footer', 11 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment