I am trying to pull in some blog options using get_blog_option() in the newblog_notify_siteadmin filter for a plugin I am writing.
I can't seem to figure out how to get the $blog_id of created blog though within my filter function.
Here is the newblog_notify_siteadmin() function from wpmu-functions.php, line 1233:
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {
global $current_site;
if( get_site_option( 'registrationnotification' ) != 'yes' )
return false;
$email = get_site_option( 'admin_email' );
if( is_email($email) == false )
return false;
$options_site_url = clean_url("http://{$current_site->domain}{$current_site->path}wp-admin/wpmu-options.php");
$msg = sprintf(__("New Blog: %1s
URL: %2s
Remote IP: %3s
Disable these notifications: %4s"), get_blog_option( $blog_id, "blogname" ), get_blog_option( $blog_id, "siteurl" ), $_SERVER['REMOTE_ADDR'], $options_site_url);
$msg = apply_filters( 'newblog_notify_siteadmin', $msg );
wp_mail( $email, sprintf(__("New Blog Registration: %s"), get_blog_option( $blog_id, "siteurl" )), $msg );
return true;
}
As you can see, $blog_id was accessible on the previous line to the apply_filters( 'newblog_notify_siteadmin', $msg ); call.
I've tried declaring global $blog_id, tried $current_blog->blog_id, but nothing seems to be in scope within my filter function.
Is there a way to access this without core code modification?