Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#11747 closed enhancement (fixed)

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

Reported by: denis-de-bernardy's profile Denis-de-Bernardy Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version: 3.0
Component: Multisite Keywords:
Focuses: Cc:

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
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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

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

  • Resolution fixed deleted
  • Status changed from closed to 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
13 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
13 years ago

  • Resolution set to fixed
  • Status changed from reopened to 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.