notice.php
61 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package ACF |
| 4 | * @author WP Engine |
| 5 | * |
| 6 | * © 2026 Advanced Custom Fields (ACF®). All rights reserved. |
| 7 | * "ACF" is a trademark of WP Engine. |
| 8 | * Licensed under the GNU General Public License v2 or later. |
| 9 | * https://www.gnu.org/licenses/gpl-2.0.html |
| 10 | */ |
| 11 | |
| 12 | // calculate add-ons (non pro only) |
| 13 | $plugins = array(); |
| 14 | |
| 15 | if ( ! acf_get_setting( 'pro' ) ) { |
| 16 | if ( is_plugin_active( 'acf-repeater/acf-repeater.php' ) ) { |
| 17 | $plugins[] = __( 'Repeater', 'acf' ); |
| 18 | } |
| 19 | if ( is_plugin_active( 'acf-flexible-content/acf-flexible-content.php' ) ) { |
| 20 | $plugins[] = __( 'Flexible Content', 'acf' ); |
| 21 | } |
| 22 | if ( is_plugin_active( 'acf-gallery/acf-gallery.php' ) ) { |
| 23 | $plugins[] = __( 'Gallery', 'acf' ); |
| 24 | } |
| 25 | if ( is_plugin_active( 'acf-options-page/acf-options-page.php' ) ) { |
| 26 | $plugins[] = __( 'Options Page', 'acf' ); |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | ?> |
| 31 | <div id="acf-upgrade-notice" class="notice notice-warning"> |
| 32 | <div class="notice-container"> |
| 33 | <div class="col-content"> |
| 34 | <img src="<?php echo esc_url( acf_get_url( 'assets/images/acf-logo.svg' ) ); ?>" /> |
| 35 | <h2><?php esc_html_e( 'Database Upgrade Required', 'acf' ); ?></h2> |
| 36 | <?php // translators: %1 plugin name, %2 version number ?> |
| 37 | <p><?php echo acf_esc_html( sprintf( __( 'Thank you for updating to %1$s v%2$s!', 'acf' ), acf_get_setting( 'name' ), acf_get_setting( 'version' ) ) ); ?><br /> |
| 38 | <?php esc_html_e( 'This version contains improvements to your database and requires an upgrade.', 'acf' ); ?></p> |
| 39 | <?php if ( ! empty( $plugins ) ) : ?> |
| 40 | <?php // translators: %s a list of plugin ?> |
| 41 | <p><?php echo acf_esc_html( sprintf( __( 'Please also check all premium add-ons (%s) are updated to the latest version.', 'acf' ), implode( ', ', $plugins ) ) ); ?></p> |
| 42 | <?php endif; ?> |
| 43 | </div> |
| 44 | <div class="col-actions"> |
| 45 | <a id="acf-upgrade-button" href="<?php echo esc_url( $button_url ); ?>" class="button-primary"><?php echo esc_html( $button_text ); ?></a> |
| 46 | </div> |
| 47 | |
| 48 | </div> |
| 49 | </div> |
| 50 | <?php if ( $confirm ) : ?> |
| 51 | <script type="text/javascript"> |
| 52 | (function($) { |
| 53 | |
| 54 | $("#acf-upgrade-button").on("click", function(){ |
| 55 | return confirm("<?php esc_attr_e( 'It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?', 'acf' ); ?>"); |
| 56 | }); |
| 57 | |
| 58 | })(jQuery); |
| 59 | </script> |
| 60 | <?php endif; ?> |
| 61 |