html-notice-upgrade.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. // calculate add-ons (non pro only)
  3. $plugins = array();
  4. if ( ! acf_get_setting( 'pro' ) ) {
  5. if ( is_plugin_active( 'acf-repeater/acf-repeater.php' ) ) {
  6. $plugins[] = __( 'Repeater', 'acf' );
  7. }
  8. if ( is_plugin_active( 'acf-flexible-content/acf-flexible-content.php' ) ) {
  9. $plugins[] = __( 'Flexible Content', 'acf' );
  10. }
  11. if ( is_plugin_active( 'acf-gallery/acf-gallery.php' ) ) {
  12. $plugins[] = __( 'Gallery', 'acf' );
  13. }
  14. if ( is_plugin_active( 'acf-options-page/acf-options-page.php' ) ) {
  15. $plugins[] = __( 'Options Page', 'acf' );
  16. }
  17. }
  18. ?>
  19. <div id="acf-upgrade-notice" class="notice">
  20. <div class="notice-container">
  21. <div class="col-content">
  22. <img src="<?php echo acf_get_url( 'assets/images/acf-logo.png' ); ?>" />
  23. <h2><?php _e( 'Database Upgrade Required', 'acf' ); ?></h2>
  24. <p><?php printf( __( 'Thank you for updating to %1$s v%2$s!', 'acf' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ); ?><br /><?php _e( 'This version contains improvements to your database and requires an upgrade.', 'acf' ); ?></p>
  25. <?php if ( ! empty( $plugins ) ) : ?>
  26. <p><?php printf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'acf' ), implode( ', ', $plugins ) ); ?></p>
  27. <?php endif; ?>
  28. </div>
  29. <div class="col-actions">
  30. <a id="acf-upgrade-button" href="<?php echo $button_url; ?>" class="acf-btn"><?php echo $button_text; ?></a>
  31. </div>
  32. </div>
  33. </div>
  34. <?php if ( $confirm ) : ?>
  35. <script type="text/javascript">
  36. (function($) {
  37. $("#acf-upgrade-button").on("click", function(){
  38. return confirm("<?php _e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf' ); ?>");
  39. });
  40. })(jQuery);
  41. </script>
  42. <?php endif; ?>