upgrade_280()WP 2.8.0

Execute changes made in WordPress 2.8.

Хуков нет.

Возвращает

null. Ничего.

Использование

upgrade_280();

Заметки

  • Global. int. $wp_current_db_version The old (current) database version.
  • Global. wpdb. $wpdb WordPress database abstraction object.

Список изменений

С версии 2.8.0 Введена.

Код upgrade_280() WP 6.0.2

function upgrade_280() {
	global $wp_current_db_version, $wpdb;

	if ( $wp_current_db_version < 10360 ) {
		populate_roles_280();
	}
	if ( is_multisite() ) {
		$start = 0;
		while ( $rows = $wpdb->get_results( "SELECT option_name, option_value FROM $wpdb->options ORDER BY option_id LIMIT $start, 20" ) ) {
			foreach ( $rows as $row ) {
				$value = maybe_unserialize( $row->option_value );
				if ( $value === $row->option_value ) {
					$value = stripslashes( $value );
				}
				if ( $value !== $row->option_value ) {
					update_option( $row->option_name, $value );
				}
			}
			$start += 20;
		}
		clean_blog_cache( get_current_blog_id() );
	}
}