WordPress.org

Make WordPress Core

Opened 3 weeks ago

Last modified 4 days ago

#49612 new defect (bug)

wpmu_new_blog hook has been deprecated. Use wp_initialize_site instead.

Reported by: asaquzzaman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description

Please use this hook wp_initialize_site instead of wp_insert_site on deprecated message. Because if we use wp_insert_site hook, we couldn’t access wp_options table for newly created sites eg: updating option table data with update_options with error message:
WordPress database error Table 'ex.wp_10_options' doesn't exist for query SELECT autoload FROM wp_10_options WHERE option_name = 'ex_version' made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site')

Attachments (1)

49612.diff (770 bytes) - added by asaquzzaman 3 weeks ago.

Download all attachments as: .zip

Change History (4)

@asaquzzaman
3 weeks ago

#1 @SergeyBiryukov
3 weeks ago

  • Component changed from General to Networks and Sites
  • Focuses multisite added

This ticket was mentioned in PR #187 on WordPress/wordpress-develop by asaquzzaman.


3 weeks ago

Please use this hook wp_initialize_site instead of wp_insert_site on deprecated message. Because if we use wp_insert_site hook, we couldn’t access wp_options table for newly created sites eg: updating option table data with update_options with error message:
WordPress database error Table 'ex.wp_10_options' doesn't exist for query SELECT autoload FROM wp_10_options WHERE option_name = 'ex_version' made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site')

Trac ticket: https://core.trac.wordpress.org/ticket/49612

#3 @SergeyBiryukov
4 days ago

Related/duplicate: #49349

Note: See TracTickets for help on using tickets.