Skip to content

Hook wpmu_new_blog callbacks to wp_insert_site / wp_initialize_site #11437

@iandunn

Description

@iandunn

Jetpack hooks into the wpmu_new_blog action in two places:

https://github.com/Automattic/jetpack/blob/ca7c26b/modules/likes.php#L80

https://github.com/Automattic/jetpack/blob/b578d60/class.jetpack-network.php#L76

WP 5.1 deprecated that hook in favor of wp_insert_site and wp_initialize_site.

Because of that, notices are being triggered when any plugin calls wp_insert_site(), even if that plugin uses the new hooks correctly. The notice is triggered if any active plugin is using the deprecated hooks. Because of that, local development workflows are broken by headers already sent crashes, and production error logs are cluttered with noise, making them less useful.

Steps to reproduce the issue

  1. Activate latest JP on WP 5.1
  2. Call wp_insert_site() from an mu-plugin, wp shell, etc

What I expected

No notices should be triggered.

What happened instead

A notice was triggered.

Screenshots

screen shot 2019-02-27 at 5 09 14 pm

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions