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.2.1 4.2.2 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.4.10 4.4.11 4.4.12 4.4.2 4.4.3 4.4.4 4.4.5 4.4.6 4.4.7 4.4.8 4.4.9 5.10 5.10.1 5.10.2 5.11 5.11.1 5.11.2 5.11.3 5.11.4 5.12 5.12.1 5.12.2 5.12.3 5.12.4 5.12.5 5.12.6 5.6.10 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 5.6.8 5.6.9 5.7.0 5.7.1 5.7.10 5.7.12 5.7.13 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 5.7.7 5.7.8 5.7.9 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.2 5.8.3 5.8.4
advanced-custom-fields / includes / admin / views / upgrade / network.php
advanced-custom-fields / includes / admin / views / upgrade Last commit date
index.php 2 years ago network.php 6 months ago notice.php 6 months ago upgrade.php 6 months ago
network.php
206 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 <style type="text/css">
13
14 /* hide steps */
15 .show-on-complete {
16 display: none;
17 }
18
19 </style>
20 <div id="acf-upgrade-wrap" class="wrap">
21
22 <h1><?php esc_html_e( 'Upgrade Database', 'acf' ); ?></h1>
23
24 <?php // translators: %s The button label name, translated seperately ?>
25 <p><?php printf( esc_html__( 'The following sites require a DB upgrade. Check the ones you want to update and then click %s.', 'acf' ), '"' . esc_html__( 'Upgrade Sites', 'acf' ) . '"' ); ?></p>
26 <p><input type="submit" name="upgrade" value="<?php esc_attr_e( 'Upgrade Sites', 'acf' ); ?>" class="button" id="upgrade-sites"></p>
27
28 <table class="wp-list-table widefat">
29 <thead>
30 <tr>
31 <td class="manage-column check-column" scope="col">
32 <input type="checkbox" id="sites-select-all">
33 </td>
34 <th class="manage-column" scope="col" style="width:33%;">
35 <label for="sites-select-all"><?php esc_html_e( 'Site', 'acf' ); ?></label>
36 </th>
37 <th><?php esc_html_e( 'Description', 'acf' ); ?></th>
38 </tr>
39 </thead>
40 <tfoot>
41 <tr>
42 <td class="manage-column check-column" scope="col">
43 <input type="checkbox" id="sites-select-all-2">
44 </td>
45 <th class="manage-column" scope="col">
46 <label for="sites-select-all-2"><?php esc_html_e( 'Site', 'acf' ); ?></label>
47 </th>
48 <th><?php esc_html_e( 'Description', 'acf' ); ?></th>
49 </tr>
50 </tfoot>
51 <tbody id="the-list">
52 <?php
53
54 $sites = acf_get_sites();
55 if ( $sites ) :
56 foreach ( $sites as $i => $site ) :
57
58 // switch blog
59 switch_to_blog( $site['blog_id'] );
60
61 ?>
62 <tr
63 <?php
64 if ( $i % 2 == 0 ) :
65 ?>
66 class="alternate"<?php endif; ?>>
67 <th class="check-column" scope="row">
68 <?php if ( acf_has_upgrade() ) : ?>
69 <input type="checkbox" value="<?php echo esc_attr( $site['blog_id'] ); ?>" name="checked[]">
70 <?php endif; ?>
71 </th>
72 <td>
73 <strong><?php echo esc_html( get_bloginfo( 'name' ) ); ?></strong><br /><?php echo esc_url( home_url() ); ?>
74 </td>
75 <td>
76 <?php if ( acf_has_upgrade() ) : ?>
77 <span class="response">
78 <?php
79 printf(
80 /* translators: %1$s current db version, %2$s available db version */
81 esc_html__( 'Site requires database upgrade from %1$s to %2$s', 'acf' ),
82 esc_html( acf_get_db_version() ),
83 esc_html( ACF_VERSION )
84 );
85 ?>
86 </span>
87 <?php else : ?>
88 <?php esc_html_e( 'Site is up to date', 'acf' ); ?>
89 <?php endif; ?>
90 </td>
91 </tr>
92 <?php
93
94 // restore
95 restore_current_blog();
96 endforeach;
97 endif;
98
99 ?>
100 </tbody>
101 </table>
102
103 <p><input type="submit" name="upgrade" value="<?php esc_attr_e( 'Upgrade Sites', 'acf' ); ?>" class="button" id="upgrade-sites-2"></p>
104 <?php // translators: %s admin dashboard url page ?>
105 <p class="show-on-complete"><?php echo acf_esc_html( sprintf( __( 'Database Upgrade complete. <a href="%s">Return to network dashboard</a>', 'acf' ), esc_url( network_admin_url() ) ) ); ?></p>
106
107 <script type="text/javascript">
108 (function($) {
109
110 var upgrader = new acf.Model({
111 events: {
112 'click #upgrade-sites': 'onClick',
113 'click #upgrade-sites-2': 'onClick'
114 },
115 $inputs: function(){
116 return $('#the-list input:checked');
117 },
118 onClick: function( e, $el ){
119
120 // prevent default
121 e.preventDefault();
122
123 // bail early if no selection
124 if( !this.$inputs().length ) {
125 return alert('<?php esc_attr_e( 'Please select at least one site to upgrade.', 'acf' ); ?>');
126 }
127
128 // confirm action
129 if( !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' ); ?>") ) {
130 return;
131 }
132
133 // upgrade
134 this.upgrade();
135 },
136 upgrade: function(){
137
138 // vars
139 var $inputs = this.$inputs();
140
141 // bail early if no sites selected
142 if( !$inputs.length ) {
143 return this.complete();
144 }
145
146 // disable buttons
147 $('.button').prop('disabled', true);
148
149 // vars
150 var $input = $inputs.first();
151 var $row = $input.closest('tr');
152 var text = '';
153 var success = false;
154
155 // show loading
156 <?php // translators: %s the version being upgraded to. ?>
157 $row.find('.response').html('<i class="acf-loading"></i></span> <?php printf( esc_attr__( 'Upgrading data to version %s', 'acf' ), esc_attr( ACF_VERSION ) ); ?>');
158
159 // send ajax request to upgrade DB
160 $.ajax({
161 url: acf.get('ajaxurl'),
162 dataType: 'json',
163 type: 'post',
164 data: acf.prepareForAjax({
165 action: 'acf/ajax/upgrade',
166 blog_id: $input.val()
167 }),
168 success: function( json ){
169 success = true;
170 $input.remove();
171 text = '<?php esc_attr_e( 'Upgrade complete.', 'acf' ); ?>';
172 },
173 error: function( jqXHR, textStatus, errorThrown ){
174 text = '<?php esc_attr_e( 'Upgrade failed.', 'acf' ); ?>';
175 if( error = acf.getXhrError(jqXHR) ) {
176 text += ' <code>' + error + '</code>';
177 }
178 },
179 complete: this.proxy(function(){
180
181 // display text
182 $row.find('.response').html( text );
183
184 // if successful upgrade, proceed to next site. Otherwise, skip to complete.
185 if( success ) {
186 this.upgrade();
187 } else {
188 this.complete();
189 }
190 })
191 });
192 },
193 complete: function(){
194
195 // enable buttons
196 $('.button').prop('disabled', false);
197
198 // show message
199 $('.show-on-complete').show();
200 }
201 });
202
203 })(jQuery);
204 </script>
205 </div>
206