Make WordPress Core

Opened 12 years ago

Closed 11 years ago

#25020 closed defect (bug) (fixed)

Introduce a sitemeta filter for populate_network

Reported by: jeremyfelt's profile jeremyfelt Owned by: nacin's profile nacin
Milestone: 3.7 Priority: normal
Severity: normal Version: 3.0
Component: Multisite Keywords: has-patch
Focuses: Cc:

Description

populate_network() can be used by a plugin to help create new networks in a multisite environment if wp-admin/includes/schema.php is loaded in as needed. As it stands now, much of the information added to the database by populate_network() is hard coded and cannot be modified as networks are created through other sources.

The attached patch adds a filter on the $sitemeta array to allow a plugin to modify network defaults before they are added to the DB. Some cleanup is also done on the formatting of the original array.

Attachments (2)

25020.diff (3.5 KB) - added by jeremyfelt 12 years ago.
25020.2.diff (3.1 KB) - added by jeremyfelt 12 years ago.

Download all attachments as: .zip

Change History (6)

@jeremyfelt
12 years ago

#1 follow-up: @nacin
12 years ago

Looks good. wp_parse_args() is however not needed. And again the @var statements are not really our style. :-)

@jeremyfelt
12 years ago

#2 in reply to: ↑ 1 @jeremyfelt
12 years ago

25020.2.diff takes out wp_parse_args() and the type hinting

Replying to nacin:

And again the @var statements are not really our style. :-)

Yet... :)

#3 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.7

#4 @nacin
11 years ago

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

In 25414:

Add populate_network_meta filter to populate_network().

props jeremyfelt.
fixes #25020.

Note: See TracTickets for help on using tickets.