-1

I have a multisite with a lot of sites on it, registered almost daily. I want to stop the automatic email being send for a new site. I n the codex, i found this filter:

apply_filters( 'send_new_site_email', bool $send, WP_Site $site, WP_User $user )

The first argument, $send, can be set to false. Then the mail will not be send.

So I am using the following add_filter function:

function disable_email($send,$site,$user){
    $send = false;
    return $send;
}
add_filter( 'send_new_site_email', 'disable_email',10,3 );

Why does this not work?

Webdever
  • 485
  • 5
  • 17
  • Btw you can use the magic `__return_false` like this `add_filter( 'send_new_site_email', '__return_false', 99 );` – Moshe Gross Sep 20 '22 at 17:04

1 Answers1

0

I think you need to increase priority, may be then it will work try something

add_filter( 'send_new_site_email', 'disable_email',25,3 );

Mukta Chowdhary
  • 184
  • 1
  • 8