Make WordPress Core


Ignore:
Timestamp:
03/08/2010 04:31:12 PM (15 years ago)
Author:
wpmuguru
Message:

move multisite upgrade functions to upgrade.php, see #11771

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

    • Property svn:ignore set to
      .empty.php.swp
  • trunk/wp-admin/includes/ms.php

    r13590 r13618  
    735735}
    736736
    737 function stripslashes_from_options( $blog_id ) {
    738     global $wpdb;
    739 
    740     if ( $blog_id == 1 ) { // check site_options too
    741         $start = 0;
    742         while( $rows = $wpdb->get_results( "SELECT meta_key, meta_value FROM {$wpdb->sitemeta} ORDER BY meta_id LIMIT $start, 20" ) ) {
    743             foreach( $rows as $row ) {
    744                 $value = $row->meta_value;
    745                 if ( !@unserialize( $value ) )
    746                     $value = stripslashes( $value );
    747                 if ( $value !== $row->meta_value ) {
    748                     update_site_option( $row->meta_key, $value );
    749                 }
    750             }
    751             $start += 20;
    752         }
    753     }
    754     $start = 0;
    755     $options_table = $wpdb->get_blog_prefix( $blog_id ) . "options";
    756     while( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $options_table ORDER BY option_id LIMIT $start, 20" ) ) {
    757         foreach( $rows as $row ) {
    758             $value = $row->option_value;
    759             if ( !@unserialize( $value ) )
    760                 $value = stripslashes( $value );
    761             if ( $value !== $row->option_value ) {
    762                 update_blog_option( $blog_id, $row->option_name, $value );
    763             }
    764         }
    765         $start += 20;
    766     }
    767     refresh_blog_details( $blog_id );
    768 }
    769 add_action( 'wpmu_upgrade_site', 'stripslashes_from_options' );
    770 
    771737function show_post_thumbnail_warning() {
    772738    if ( ! is_super_admin() )
Note: See TracChangeset for help on using the changeset viewer.