Changes from branches/3.3/wp-admin/includes/ms.php at r19654 to trunk/wp-admin/includes/ms.php at r20952
- File:
-
- 1 edited
-
trunk/wp-admin/includes/ms.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/ms.php
r19654 r20952 50 50 * 51 51 * @param int $blog_id Blog ID 52 * @param bool $drop True if blog's table should be dropped. Default is false.52 * @param bool $drop True if blog's table should be dropped. Default is false. 53 53 * @return void 54 54 */ … … 90 90 } 91 91 92 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->blogs WHERE blog_id = %d", $blog_id ) ); 92 $wpdb->delete( $wpdb->blogs, array( 'blog_id' => $blog_id ) ); 93 93 94 $dir = apply_filters( 'wpmu_delete_blog_upload_dir', WP_CONTENT_DIR . "/blogs.dir/{$blog_id}/files/", $blog_id ); 94 95 $dir = rtrim( $dir, DIRECTORY_SEPARATOR ); … … 116 117 } 117 118 118 $stack = array_reverse( $stack ); // Last added dirs are deepest119 $stack = array_reverse( $stack ); // Last added dirs are deepest 119 120 foreach( (array) $stack as $dir ) { 120 121 if ( $dir != $top_dir) … … 132 133 133 134 $id = (int) $id; 135 $user = new WP_User( $id ); 134 136 135 137 do_action( 'wpmu_delete_user', $id ); … … 159 161 } 160 162 161 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->users WHERE ID = %d", $id ) ); 162 $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id ) ); 163 164 clean_user_cache( $id ); 163 $meta = $wpdb->get_col( $wpdb->prepare( "SELECT umeta_id FROM $wpdb->usermeta WHERE user_id = %d", $id ) ); 164 foreach ( $meta as $mid ) 165 delete_metadata_by_mid( 'user', $mid ); 166 167 $wpdb->delete( $wpdb->users, array( 'ID' => $id ) ); 168 169 clean_user_cache( $user ); 165 170 166 171 // allow for commit transaction … … 168 173 169 174 return true; 170 }171 172 function wpmu_get_blog_allowedthemes( $blog_id = 0 ) {173 $themes = get_themes();174 175 if ( $blog_id != 0 )176 switch_to_blog( $blog_id );177 178 $blog_allowed_themes = get_option( 'allowedthemes' );179 if ( !is_array( $blog_allowed_themes ) || empty( $blog_allowed_themes ) ) { // convert old allowed_themes to new allowedthemes180 $blog_allowed_themes = get_option( 'allowed_themes' );181 182 if ( is_array( $blog_allowed_themes ) ) {183 foreach( (array) $themes as $key => $theme ) {184 $theme_key = esc_html( $theme['Stylesheet'] );185 if ( isset( $blog_allowed_themes[$key] ) == true ) {186 $blog_allowedthemes[$theme_key] = 1;187 }188 }189 $blog_allowed_themes = $blog_allowedthemes;190 add_option( 'allowedthemes', $blog_allowed_themes );191 delete_option( 'allowed_themes' );192 }193 }194 195 if ( $blog_id != 0 )196 restore_current_blog();197 198 return $blog_allowed_themes;199 175 } 200 176 … … 296 272 } 297 273 add_action( 'admin_notices', 'new_user_email_admin_notice' ); 298 299 function get_site_allowed_themes() {300 $themes = get_themes();301 $allowed_themes = get_site_option( 'allowedthemes' );302 if ( !is_array( $allowed_themes ) || empty( $allowed_themes ) ) {303 $allowed_themes = get_site_option( 'allowed_themes' ); // convert old allowed_themes format304 if ( !is_array( $allowed_themes ) ) {305 $allowed_themes = array();306 } else {307 foreach( (array) $themes as $key => $theme ) {308 $theme_key = esc_html( $theme['Stylesheet'] );309 if ( isset( $allowed_themes[ $key ] ) == true ) {310 $allowedthemes[ $theme_key ] = 1;311 }312 }313 $allowed_themes = $allowedthemes;314 }315 }316 return $allowed_themes;317 }318 274 319 275 /** … … 424 380 <tr> 425 381 <th><?php _e( 'Site Upload Space Quota '); ?></th> 426 <td><input type=" text" size="3" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td>382 <td><input type="number" step="1" min="0" style="width: 100px" name="option[blog_upload_space]" value="<?php echo $quota; ?>" /> <?php _e( 'MB (Leave blank for network default)' ); ?></td> 427 383 </tr> 428 384 <?php … … 433 389 global $wpdb; 434 390 435 if ( null !== $deprecated )391 if ( null !== $deprecated ) 436 392 _deprecated_argument( __FUNCTION__, '3.1' ); 437 393 438 394 $wpdb->update( $wpdb->users, array( $pref => $value ), array( 'ID' => $id ) ); 439 395 440 clean_user_cache( $id ); 396 $user = new WP_User( $id ); 397 clean_user_cache( $user ); 441 398 442 399 if ( $pref == 'spam' ) { … … 456 413 return false; 457 414 458 clean_user_cache( $ id);415 clean_user_cache( $user ); 459 416 460 417 return $id; … … 552 509 } else { 553 510 $translated = format_code_lang( $code_lang ); 554 $output[$translated] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html ( $translated ) . '</option>';511 $output[$translated] = '<option value="' . esc_attr( $code_lang ) . '"' . selected( $current, $code_lang, false ) . '> ' . esc_html ( $translated ) . '</option>'; 555 512 } 556 513 … … 637 594 if ( $primary_blog == $blog->userblog_id ) 638 595 $found = true; 639 ?><option value="<?php echo $blog->userblog_id ?>"<?php selected( $primary_blog, $blog->userblog_id ); ?>><?php echo esc_url( get_home_url( $blog->userblog_id ) ) ?></option><?php596 ?><option value="<?php echo $blog->userblog_id ?>"<?php selected( $primary_blog, $blog->userblog_id ); ?>><?php echo esc_url( get_home_url( $blog->userblog_id ) ) ?></option><?php 640 597 } ?> 641 598 </select> … … 774 731 * 775 732 * The default criteria for a large network is either more than 10,000 users or more than 10,000 sites. 776 * Plugins can alter this criteria using the 'wp_is_large_network' filter.733 * Plugins can alter this criteria using the 'wp_is_large_network' filter. 777 734 * 778 735 * @since 3.3.0 779 * @param string $using 'sites or 'users'. Default is 'sites'.736 * @param string $using 'sites or 'users'. Default is 'sites'. 780 737 * @return bool True if the network meets the criteria for large. False otherwise. 781 738 */ … … 789 746 return apply_filters( 'wp_is_large_network', $count > 10000, 'sites', $count ); 790 747 } 791 ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)