Make WordPress Core

Ticket #27517: 24398.patch

File 24398.patch, 2.3 KB (added by tubiz, 11 years ago)
  • wp-admin/network/sites.php

     
    8282                exit();
    8383        }
    8484
     85        if ( 'confirmallblogs' === $_GET['action'] ) {
     86                check_admin_referer( 'bulk-sites' );
     87
     88                if ( ! headers_sent() ) {
     89                        nocache_headers();
     90                        header( 'Content-Type: text/html; charset=utf-8' );
     91                }
     92
     93                require_once( ABSPATH . 'wp-admin/admin-header.php' );
     94                ?>
     95                        <div class="wrap">
     96                                <h2><?php _e( 'Confirm your action' ); ?></h2>
     97                                <form action="sites.php?action=allblogs" method="post">
     98                                <?php
     99                                        foreach ( (array) $_POST['allblogs'] as $key => $val ) {
     100                                                $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_blog_details( $val )->domain, '', $blog['domain'] ) : get_blog_details( $val )->path;
     101
     102                                                if ( 'delete' === $_POST['action'] ) {
     103                                                        $msg =  sprintf( __( 'You are about to delete the site %s' ), $blogname );
     104                                                }
     105                                                if ( 'spam' === $_POST['action'] ) {
     106                                                        $msg =  sprintf( __( 'You are about to mark the site %s as spam.' ), $blogname );
     107                                                }
     108                                                if ( 'notspam' === $_POST['action'] ) {
     109                                                        $msg = sprintf( __( 'You are about to unspam the site %s' ), $blogname );
     110                                                }
     111                                ?>
     112                                                <input type="hidden" name="allblogs[]" value="<?php echo esc_attr( $val ); ?>" />
     113                                                <p><?php echo $msg; ?></p>
     114                                <?php
     115                                        }
     116                                ?>
     117                                        <input type="hidden" name="action" value="<?php echo esc_attr( $_POST['action'] ) ?>" />
     118                                        <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" />
     119                                        <?php wp_nonce_field( 'bulk-sites', '_wpnonce', false ); ?>
     120                                        <?php submit_button( __( 'Confirm' ), 'button' ); ?>
     121                                </form>
     122                        </div>
     123                <?php
     124                require_once( ABSPATH . 'wp-admin/admin-footer.php' );
     125                exit();
     126        }
     127
     128
    85129        $updated_action = '';
    86130
    87131        $manage_actions = array( 'deleteblog', 'allblogs', 'archiveblog', 'unarchiveblog', 'activateblog', 'deactivateblog', 'unspamblog', 'spamblog', 'unmatureblog', 'matureblog' );
     
    266310<input type="hidden" name="action" value="blogs" />
    267311</form>
    268312
    269 <form id="form-site-list" action="sites.php?action=allblogs" method="post">
     313<form id="form-site-list" action="sites.php?action=confirmallblogs" method="post">
    270314        <?php $wp_list_table->display(); ?>
    271315</form>
    272316</div>