update-notice.php 735 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. /**
  3. * Suggest things to do after a theme update
  4. *
  5. * @package vamtam/consulting
  6. */
  7. class VamtamUpdateNotice {
  8. /**
  9. * Key for the option which holds the last theme version
  10. *
  11. * @var string
  12. */
  13. public static $last_version_key = '-vamtam-last-theme-version';
  14. /**
  15. * checks if the theme has been updated
  16. * and the update message has not been dismissed
  17. */
  18. public static function check() {
  19. $current_version = VamtamFramework::get_version();
  20. $last_known_version = get_option( VAMTAM_THEME_SLUG . self::$last_version_key );
  21. if ( $current_version !== $last_known_version ) {
  22. vamtam_recompile_css();
  23. update_option( VAMTAM_THEME_SLUG . self::$last_version_key, VamtamFramework::get_version() );
  24. }
  25. }
  26. }