Make WordPress Core

Opened 17 years ago

Closed 17 years ago

#11747 closed enhancement (fixed)

make install_blog_defaults() use the stuff in the normal WP installer

Reported by: Denis-de-Bernardy Owned by:
Priority: normal Milestone: 3.0
Component: Multisite Version: 3.0
Severity: normal Keywords:
Cc: Focuses:

Description

there seems to be a lot of redundant code in there. for the sake of not maintaining it twice, we should re-engineer this so it uses the normal WP installer

Change History (4)

#1 follow-up: @ryan
17 years ago

  • Resolution → fixed
  • Status new → closed

(In [12776]) Deprecate wp_install_blog_defaults(). Use wp_install_defaults() instead. fixes #11747 see #11644

#2 in reply to: ↑ 1 @jamescollins
17 years ago

  • Resolution fixed
  • Status closed → reopened

In [12776], I noticed that line 245 of wp-admin/includes/upgrade.php contains:

$wpdb->update( $wpdb->options, array('option_value' => $user->user_email), array('option_name' => 'admin_email') );

Is there any reason why

update_option('admin_email', $user->user_email);

isn't used instead?

I realise that the $wpdb->update() call comes from old WPMU code, but it'd be good to update it because it might cause problems for people using an object cache.

#3 follow-up: @ryan
17 years ago

Using straight queries instead of higher-level API is typical of the upgrade and install code. It is done to avoid polluting cache, triggering actions, and exercising parts of the API that rely on database updates that might not have taken place yet.

#4 in reply to: ↑ 3 @jamescollins
17 years ago

  • Resolution → fixed
  • Status reopened → closed

Replying to ryan:

Using straight queries instead of higher-level API is typical of the upgrade and install code. It is done to avoid polluting cache, triggering actions, and exercising parts of the API that rely on database updates that might not have taken place yet.

Thanks for the clarification Ryan. That makes sense.

Note: See TracTickets for help on using tickets.