Changeset 42343 for trunk/src/wp-admin/network/site-info.php
- Timestamp:
- 11/30/2017 11:09:33 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/site-info.php
r41065 r42343 21 21 22 22 if ( ! $id ) { 23 wp_die( __( 'Invalid site ID.') );23 wp_die( __( 'Invalid site ID.' ) ); 24 24 } 25 25 … … 34 34 35 35 $parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME ); 36 $is_main_site = is_main_site( $id );36 $is_main_site = is_main_site( $id ); 37 37 38 38 if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) { … … 44 44 delete_option( 'rewrite_rules' ); 45 45 46 $blog_data = wp_unslash( $_POST['blog'] );46 $blog_data = wp_unslash( $_POST['blog'] ); 47 47 $blog_data['scheme'] = $parsed_scheme; 48 48 … … 50 50 // On the network's main site, don't allow the domain or path to change. 51 51 $blog_data['domain'] = $details->domain; 52 $blog_data['path'] = $details->path;52 $blog_data['path'] = $details->path; 53 53 } else { 54 54 // For any other site, the scheme, domain, and path can all be changed. We first … … 68 68 $blog_data['scheme'] = $update_parsed_url['scheme']; 69 69 $blog_data['domain'] = $update_parsed_url['host']; 70 $blog_data['path'] = $update_parsed_url['path'];71 } 72 73 $existing_details = get_site( $id );70 $blog_data['path'] = $update_parsed_url['path']; 71 } 72 73 $existing_details = get_site( $id ); 74 74 $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' ); 75 75 foreach ( $blog_data_checkboxes as $c ) { … … 86 86 $new_details = get_site( $id ); 87 87 88 $old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );88 $old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) ); 89 89 $old_home_parsed = parse_url( $old_home_url ); 90 90 … … 94 94 } 95 95 96 $old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );96 $old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) ); 97 97 $old_site_parsed = parse_url( $old_site_url ); 98 98 … … 103 103 104 104 restore_current_blog(); 105 wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php' ) ); 105 wp_redirect( 106 add_query_arg( 107 array( 108 'update' => 'updated', 109 'id' => $id, 110 ), 'site-info.php' 111 ) 112 ); 106 113 exit; 107 114 } … … 117 124 $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); 118 125 119 $parent_file = 'sites.php';126 $parent_file = 'sites.php'; 120 127 $submenu_file = 'sites.php'; 121 128 … … 129 136 <?php 130 137 131 network_edit_site_nav( array( 132 'blog_id' => $id, 133 'selected' => 'site-info' 134 ) ); 138 network_edit_site_nav( 139 array( 140 'blog_id' => $id, 141 'selected' => 'site-info', 142 ) 143 ); 135 144 136 145 if ( ! empty( $messages ) ) { … … 142 151 <form method="post" action="site-info.php?action=update-site"> 143 152 <?php wp_nonce_field( 'edit-site' ); ?> 144 <input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />153 <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" /> 145 154 <table class="form-table"> 146 155 <?php 147 156 // The main site of the network should not be updated on this page. 148 if ( $is_main_site ) : ?> 157 if ( $is_main_site ) : 158 ?> 149 159 <tr class="form-field"> 150 160 <th scope="row"><?php _e( 'Site Address (URL)' ); ?></th> … … 153 163 <?php 154 164 // For any other site, the scheme, domain, and path can all be changed. 155 else : ?> 165 else : 166 ?> 156 167 <tr class="form-field form-required"> 157 168 <th scope="row"><?php _e( 'Site Address (URL)' ); ?></th> … … 161 172 162 173 <tr class="form-field"> 163 <th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ) ?></label></th>164 <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" /></td>174 <th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ); ?></label></th> 175 <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ); ?>" /></td> 165 176 </tr> 166 177 <tr class="form-field"> 167 178 <th scope="row"><label for="blog_last_updated"><?php _e( 'Last Updated' ); ?></label></th> 168 <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" /></td>179 <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ); ?>" /></td> 169 180 </tr> 170 181 <?php … … 181 192 <td> 182 193 <fieldset> 183 <legend class="screen-reader-text"><?php _e( 'Set site attributes' ) ?></legend>194 <legend class="screen-reader-text"><?php _e( 'Set site attributes' ); ?></legend> 184 195 <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?> 185 <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> /> 196 <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" 197 <?php 198 checked( (bool) $details->$field_key, true ); 199 disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); 200 ?> 201 /> 186 202 <?php echo $field_label; ?></label><br/> 187 203 <?php endforeach; ?>
Note: See TracChangeset
for help on using the changeset viewer.