| 68 | | if ( isset( $_POST['update_home_url'] ) && $_POST['update_home_url'] == 'update' ) { |
| 69 | | $new_details = get_blog_details( $id, false ); |
| 70 | | $blog_address = esc_url_raw( $new_details->domain . $new_details->path ); |
| 71 | | if ( get_option( 'siteurl' ) != $blog_address ) { |
| 72 | | update_option( 'siteurl', $blog_address ); |
| 73 | | } |
| 74 | | if ( get_option( 'home' ) != $blog_address ) { |
| 75 | | update_option( 'home', $blog_address ); |
| 76 | | } |
| | 68 | // Maybe update home and siteurl options |
| | 69 | $updated_details = get_blog_details( $id, false ); |
| | 70 | $old_address = esc_url_raw( $existing_details->domain . $existing_details->path ); |
| | 71 | $new_address = esc_url_raw( $updated_details->domain . $updated_details->path ); |
| | 72 | if ( get_option( 'home' ) === untrailingslashit( $old_address ) ) { |
| | 73 | update_option( 'home', $new_address ); |
| 137 | | <th scope="row"><?php _e( 'Path' ) ?></th> |
| 138 | | <td><code><?php echo esc_attr( $details->path ) ?></code></td> |
| 139 | | <?php |
| 140 | | } else { |
| 141 | | switch_to_blog( $id ); |
| 142 | | ?> |
| 143 | | <th scope="row"><label for="path"><?php _e( 'Path' ) ?></label></th> |
| 144 | | <td> |
| 145 | | <input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" /><br /> |
| 146 | | <input type="checkbox" name="update_home_url" id="update_home_url" value="update" <?php if ( get_option( 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_option( 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <label for="update_home_url"><?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></label> |
| 147 | | </td> |
| 148 | | <?php |
| 149 | | restore_current_blog(); |
| 150 | | } ?> |
| | 137 | <th scope="row"><?php _e( 'Path' ) ?></th> |
| | 138 | <td><code><?php echo esc_attr( $details->path ) ?></code></td> |
| | 139 | <?php } else { ?> |
| | 140 | <th scope="row"><label for="path"><?php _e( 'Path' ) ?></label></th> |
| | 141 | <td><input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" /></td> |
| | 142 | <?php } ?> |