Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UNL-CAS-plugin-for-Wordpress-MU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tim Steiner
UNL-CAS-plugin-for-Wordpress-MU
Commits
42d2d22c
Commit
42d2d22c
authored
15 years ago
by
Tim Steiner
Browse files
Options
Downloads
Patches
Plain Diff
Send an email to a user when they create a new blog.
parent
a5fb3fc1
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
unl.php
+40
-0
40 additions, 0 deletions
unl.php
with
40 additions
and
0 deletions
unl.php
+
40
−
0
View file @
42d2d22c
...
@@ -119,9 +119,49 @@ function unl_new_blog($blogId)
...
@@ -119,9 +119,49 @@ function unl_new_blog($blogId)
{
{
switch_to_blog
(
$blogId
);
switch_to_blog
(
$blogId
);
switch_theme
(
'unl_modern'
,
'unl_modern'
);
switch_theme
(
'unl_modern'
,
'unl_modern'
);
unl_new_blog_notification
(
$blogId
);
restore_current_blog
();
restore_current_blog
();
}
}
function
unl_new_blog_notification
(
$blogId
)
{
$welcomeEmail
=
'Your new SITE_NAME blog has been successfully set up at:
BLOG_URL
You can log in to the administrator account with your My.UNL account
Login Here: BLOG_URLwp-admin/
We hope you enjoy your new weblog.
Thanks!
--The WordPress Team
SITE_NAME'
;
$url
=
get_blogaddress_by_id
(
$blogId
);
$user
=
wp_get_current_user
();
$title
=
get_bloginfo
(
'title'
);
$currentSite
=
$GLOBALS
[
'current_site'
];
$welcomeEmail
=
str_replace
(
"SITE_NAME"
,
$currentSite
->
site_name
,
$welcomeEmail
);
$welcomeEmail
=
str_replace
(
"BLOG_TITLE"
,
$title
,
$welcomeEmail
);
$welcomeEmail
=
str_replace
(
"BLOG_URL"
,
$url
,
$welcomeEmail
);
$admin_email
=
get_site_option
(
"admin_email"
);
if
(
$admin_email
==
''
)
$admin_email
=
'support@'
.
$_SERVER
[
'SERVER_NAME'
];
$from_name
=
get_site_option
(
"site_name"
)
==
''
?
'WordPress'
:
wp_specialchars
(
get_site_option
(
"site_name"
)
);
$message_headers
=
"MIME-Version: 1.0
\n
"
.
"From:
\"
{
$from_name
}
\"
<
{
$admin_email
}
>
\n
"
.
"Content-Type: text/plain; charset=
\"
"
.
get_option
(
'blog_charset'
)
.
"
\"\n
"
;
$message
=
$welcomeEmail
;
if
(
empty
(
$current_site
->
site_name
)
)
$currentSite
->
site_name
=
"WordPress MU"
;
$subject
=
apply_filters
(
'update_welcome_subject'
,
sprintf
(
__
(
'New %1$s Blog: %2$s'
),
$currentSite
->
site_name
,
stripslashes
(
$title
)
)
);
wp_mail
(
$user
->
user_email
,
$subject
,
$message
,
$message_headers
);
return
true
;
}
add_action
(
'set_current_user'
,
'unl_set_current_user'
,
0
);
add_action
(
'set_current_user'
,
'unl_set_current_user'
,
0
);
add_action
(
'plugins_loaded'
,
'unl_init'
);
add_action
(
'plugins_loaded'
,
'unl_init'
);
add_action
(
'auth_redirect'
,
'unl_auth_redirect'
);
add_action
(
'auth_redirect'
,
'unl_auth_redirect'
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment