Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#48554 closed enhancement (fixed)

$blog_id missing in the newblog_notify_siteadmin filter

Reported by: virgodesign's profile virgodesign Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.4 Priority: normal
Severity: normal Version: 5.2.4
Component: Networks and Sites Keywords: good-first-bug has-patch has-dev-note
Focuses: multisite Cc:

Description

Hi,
in a wordpress multisite environment there is the newblog_notify_siteadmin( $blog_id, $deprecated ) function that notifies the network admin that a new site has been activated. This function prepare and send the email notice to the network admin just after a news site has been created.

The message is filtered by the newblog_notify_siteadmin hook before the email is sent.

In my opinion this filter does not give a real chance to customize the message because there is no informations passed in about the new created blog.

This is how the filter is

$msg = apply_filters( 'newblog_notify_siteadmin', $msg );

and this is how it should be

$msg = apply_filters( 'newblog_notify_siteadmin', $msg, $blog_id );

This will also create consistency with the

$msg = apply_filters( 'newuser_notify_siteadmin', $msg, $user );

filter, also located in ms-functions.php and related to the new user registration.

Attachments (3)

48554.diff (562 bytes) - added by mukto90 5 years ago.
48554.2.diff (639 bytes) - added by mukto90 5 years ago.
48554.3.diff (629 bytes) - added by mukto90 5 years ago.

Download all attachments as: .zip

Change History (8)

#1 @SergeyBiryukov
5 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 5.4

@mukto90
5 years ago

#2 @mukto90
5 years ago

  • Keywords has-patch added; needs-patch removed

@mukto90
5 years ago

@mukto90
5 years ago

#3 @SergeyBiryukov
5 years ago

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

In 46697:

Networks and Sites: Pass the $blog_id parameter to the newblog_notify_siteadmin filter.

Props mukto90, virgodesign.
Fixes #48554.

#4 @audrasjb
5 years ago

  • Keywords needs-dev-note added

#5 @audrasjb
5 years ago

  • Keywords has-dev-note added; needs-dev-note removed
Note: See TracTickets for help on using tickets.