Skip to content

Instantly share code, notes, and snippets.

@adamharley
Created August 23, 2011 16:46
Show Gist options
  • Save adamharley/1165812 to your computer and use it in GitHub Desktop.
Save adamharley/1165812 to your computer and use it in GitHub Desktop.
SVN revision in WP admin footer version
<?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