feat: Display theme version in admin footer
Some checks failed
Deployment / wordpress (push) Failing after 1s
Deployment / nuxt (push) Has been cancelled

This commit is contained in:
2026-01-27 20:24:55 -05:00
parent c6dfbeb247
commit b886585be1
2 changed files with 9 additions and 1 deletions

View File

@@ -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 ) );
}

View File

@@ -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
*/ */