feat: Display theme version in admin footer
This commit is contained in:
@@ -31,3 +31,12 @@ function moonshine_bypass_home_url( $url, $path, $orig_scheme, $blog_id ) {
|
|||||||
}
|
}
|
||||||
return $url;
|
return $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Display theme version in admin footer
|
||||||
|
add_filter( 'update_footer', 'moonshine_update_footer', 100 );
|
||||||
|
function moonshine_update_footer() {
|
||||||
|
$package_json = json_decode( file_get_contents( get_theme_file_path( 'package.json' ) ), true );
|
||||||
|
$name = $package_json['name'] ?? 'moonshine';
|
||||||
|
$version = $package_json['version'] ?? '(unknown)';
|
||||||
|
return sprintf( '%s v%s', esc_html( $name ), esc_html( $version ) );
|
||||||
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ Theme Name: Moonshine
|
|||||||
Author: Pascal Martineau <pascal@lewebsimple.ca>
|
Author: Pascal Martineau <pascal@lewebsimple.ca>
|
||||||
Author URI: https://websimple.com/
|
Author URI: https://websimple.com/
|
||||||
Description: Headless WordPress theme based on Nuxt.
|
Description: Headless WordPress theme based on Nuxt.
|
||||||
Version: 0.1.6
|
|
||||||
Text Domain: moonshine
|
Text Domain: moonshine
|
||||||
Template: kaliroots
|
Template: kaliroots
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user