Geen omschrijving

html-notice-upgrade.php 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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="col-content">
  21. <img src="<?php echo acf_get_url( 'assets/images/acf-logo.png' ); ?>" />
  22. <h2><?php _e( 'Database Upgrade Required', 'acf' ); ?></h2>
  23. <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>
  24. <?php if ( ! empty( $plugins ) ) : ?>
  25. <p><?php printf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'acf' ), implode( ', ', $plugins ) ); ?></p>
  26. <?php endif; ?>
  27. </div>
  28. <div class="col-actions">
  29. <a id="acf-upgrade-button" href="<?php echo $button_url; ?>" class="button button-primary button-hero"><?php echo $button_text; ?></a>
  30. </div>
  31. </div>
  32. <?php if ( $confirm ) : ?>
  33. <script type="text/javascript">
  34. (function($) {
  35. $("#acf-upgrade-button").on("click", function(){
  36. 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' ); ?>");
  37. });
  38. })(jQuery);
  39. </script>
  40. <?php endif; ?>