Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#28540 closed enhancement (wontfix)

Introduce wpmu_create_blog meta filter

Reported by: compute's profile Compute Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

I'd like to add meta to my new blog/site when the wpmu_create_blog() is called.

As it is right now you can do that by using the 'wpmu_new_blog' filter. Adding a hook for addional blog meta during the installation would make this task even easier and thats why I'm suggestion to introduce a 'wpmu_create_blog meta' filter

Attachments (1)

28540.diff (583 bytes) - added by Compute 10 years ago.
Add a filter for $meta

Download all attachments as: .zip

Change History (5)

@Compute
10 years ago

Add a filter for $meta

#1 @Compute
10 years ago

Related:
#27287

#2 @jeremyfelt
10 years ago

  • Type changed from feature request to enhancement

Hi Compute, thanks for the ticket and the patch!

I'm not completely convinced we need this, as using update_option() to add your data and perform other tasks while hooked into wpmu_new_blog is pretty straight forward. The concept of "meta" here is also somewhat misleading (to me), as the data doesn't end up in any meta table, but in the new site's options.

The default data passed around as $meta here really amounts to whether the site is public and what the lang_id option should be. There is a filter on signups with add_signup_meta that could pass more in some scenarios. It is somewhat strange that a filter exists there for modifying the "meta" but nowhere else.

If this filter was added, looking at your patch, we would want to put it above the wp_parse_args() line here so that we could continue to ensure that defaults exist. The function relies on the existence of public later on. Also check out how hooks are now documented in core.

#3 @Compute
10 years ago

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

Will just use wpmu_new_blog instead. Thanks.

#4 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.