~canonical-sysadmins/wordpress/4.8.3

« back to all changes in this revision

Viewing changes to wp-admin/update-core.php

  • Committer: Ryan Finnie
  • Date: 2015-08-31 16:09:47 UTC
  • mfrom: (1.1.9 upstream)
  • Revision ID: ryan.finnie@canonical.com-20150831160947-1h6rfxby9z1ec62u
Merge WP4.3 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
if ( ! current_user_can( 'update_core' ) && ! current_user_can( 'update_themes' ) && ! current_user_can( 'update_plugins' ) )
23
23
        wp_die( __( 'You do not have sufficient permissions to update this site.' ) );
24
24
 
 
25
/**
 
26
 *
 
27
 * @global string $wp_local_package
 
28
 * @global wpdb   $wpdb
 
29
 * @global string $wp_version
 
30
 *
 
31
 * @staticvar bool $first_pass
 
32
 *
 
33
 * @param object $update
 
34
 */
25
35
function list_core_update( $update ) {
26
36
        global $wp_local_package, $wpdb, $wp_version;
27
37
        static $first_pass = true;
104
114
 
105
115
}
106
116
 
 
117
/**
 
118
 * @since 2.7.0
 
119
 */
107
120
function dismissed_updates() {
108
121
        $dismissed = get_core_updates( array( 'dismissed' => true, 'available' => false ) );
109
122
        if ( $dismissed ) {
136
149
 *
137
150
 * @since 2.7.0
138
151
 *
139
 
 * @return null
 
152
 * @global string $wp_version
 
153
 * @global string $required_php_version
 
154
 * @global string $required_mysql_version
140
155
 */
141
156
function core_upgrade_preamble() {
142
157
        global $wp_version, $required_php_version, $required_mysql_version;
162
177
                }
163
178
                echo '</h3>';
164
179
        } else {
165
 
                echo '<div class="updated inline"><p>';
 
180
                echo '<div class="notice notice-warning"><p>';
166
181
                _e('<strong>Important:</strong> before updating, please <a href="https://codex.wordpress.org/WordPress_Backups">back up your database and files</a>. For help with updates, visit the <a href="https://codex.wordpress.org/Updating_WordPress">Updating WordPress</a> Codex page.');
167
182
                echo '</p></div>';
168
183
 
198
213
        dismissed_updates();
199
214
}
200
215
 
 
216
/**
 
217
 *
 
218
 * @global string $wp_version
 
219
 */
201
220
function list_plugin_updates() {
202
221
        global $wp_version;
203
222
 
226
245
<table class="widefat" id="update-plugins-table">
227
246
        <thead>
228
247
        <tr>
229
 
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></th>
 
248
                <td scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all" /></td>
230
249
                <th scope="col" class="manage-column"><label for="plugins-select-all"><?php _e('Select All'); ?></label></th>
231
250
        </tr>
232
251
        </thead>
279
298
 
280
299
        <tfoot>
281
300
        <tr>
282
 
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></th>
 
301
                <td scope="col" class="manage-column check-column"><input type="checkbox" id="plugins-select-all-2" /></td>
283
302
                <th scope="col" class="manage-column"><label for="plugins-select-all-2"><?php _e( 'Select All' ); ?></label></th>
284
303
        </tr>
285
304
        </tfoot>
289
308
<?php
290
309
}
291
310
 
 
311
/**
 
312
 * @since 2.9.0
 
313
 */
292
314
function list_theme_updates() {
293
315
        $themes = get_theme_updates();
294
316
        if ( empty( $themes ) ) {
298
320
        }
299
321
 
300
322
        $form_action = 'update-core.php?action=do-theme-upgrade';
301
 
 
302
323
?>
303
324
<h3><?php _e( 'Themes' ); ?></h3>
304
325
<p><?php _e( 'The following themes have new versions available. Check the ones you want to update and then click &#8220;Update Themes&#8221;.' ); ?></p>
309
330
<table class="widefat" id="update-themes-table">
310
331
        <thead>
311
332
        <tr>
312
 
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></th>
 
333
                <td scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all" /></td>
313
334
                <th scope="col" class="manage-column"><label for="themes-select-all"><?php _e('Select All'); ?></label></th>
314
335
        </tr>
315
336
        </thead>
328
349
 
329
350
        <tfoot>
330
351
        <tr>
331
 
                <th scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></th>
 
352
                <td scope="col" class="manage-column check-column"><input type="checkbox" id="themes-select-all-2" /></td>
332
353
                <th scope="col" class="manage-column"><label for="themes-select-all-2"><?php _e( 'Select All' ); ?></label></th>
333
354
        </tr>
334
355
        </tfoot>
338
359
<?php
339
360
}
340
361
 
 
362
/**
 
363
 * @since 3.7.0
 
364
 */
341
365
function list_translation_updates() {
342
366
        $updates = wp_get_translation_updates();
343
367
        if ( ! $updates ) {
364
388
 *
365
389
 * @since 2.7.0
366
390
 *
367
 
 * @return null
 
391
 * @global WP_Filesystem_Base $wp_filesystem Subclass
 
392
 *
 
393
 * @param bool $reinstall
368
394
 */
369
395
function do_core_upgrade( $reinstall = false ) {
370
396
        global $wp_filesystem;
389
415
 
390
416
?>
391
417
        <div class="wrap">
392
 
        <h2><?php _e('Update WordPress'); ?></h2>
 
418
        <h1><?php _e( 'Update WordPress' ); ?></h1>
393
419
<?php
394
420
 
395
421
        if ( false === ( $credentials = request_filesystem_credentials( $url, '', false, ABSPATH, array( 'version', 'locale' ), $allow_relaxed_file_ownership ) ) ) {
440
466
        <?php
441
467
}
442
468
 
 
469
/**
 
470
 * @since 2.7.0
 
471
 */
443
472
function do_dismiss_core_update() {
444
473
        $version = isset( $_POST['version'] )? $_POST['version'] : false;
445
474
        $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
451
480
        exit;
452
481
}
453
482
 
 
483
/**
 
484
 * @since 2.7.0
 
485
 */
454
486
function do_undismiss_core_update() {
455
487
        $version = isset( $_POST['version'] )? $_POST['version'] : false;
456
488
        $locale = isset( $_POST['locale'] )? $_POST['locale'] : 'en_US';
510
542
        require_once(ABSPATH . 'wp-admin/admin-header.php');
511
543
        ?>
512
544
        <div class="wrap">
513
 
        <h2><?php _e('WordPress Updates'); ?></h2>
 
545
        <h1><?php _e( 'WordPress Updates' ); ?></h1>
514
546
        <?php
515
547
        if ( $upgrade_error ) {
516
548
                echo '<div class="error"><p>';
592
624
 
593
625
        require_once(ABSPATH . 'wp-admin/admin-header.php');
594
626
        echo '<div class="wrap">';
595
 
        echo '<h2>' . esc_html__('Update Plugins') . '</h2>';
 
627
        echo '<h1>' . __( 'Update Plugins' ) . '</h1>';
596
628
        echo '<iframe src="', $url, '" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0"></iframe>';
597
629
        echo '</div>';
598
630
        include(ABSPATH . 'wp-admin/admin-footer.php');
621
653
        require_once(ABSPATH . 'wp-admin/admin-header.php');
622
654
        ?>
623
655
        <div class="wrap">
624
 
                <h2><?php echo esc_html__('Update Themes') ?></h2>
 
656
                <h1><?php _e( 'Update Themes' ); ?></h1>
625
657
                <iframe src="<?php echo $url ?>" style="width: 100%; height: 100%; min-height: 750px;" frameborder="0"></iframe>
626
658
        </div>
627
659
        <?php