We need to limit the blog names users may choose when they create their own blogs.
We have a WordPress Network configured to have all blogs share a domain name. E.g., domain.name.com/x, domain.name.com/y, etc.
We have integrated our WordPress Network with our corporate Active Directory using the Active Directory Integration plugin. That plugin puts the user’s mailnickname attribute (the part of the email address before the @
) into the nickname field.
I would like to allow users to self-create their own blogs but restrict blog names names so that it must match the nickname field of their WordPress account. E.g., a user with nickname jdoe could only create a blog named domain.name.com/jdoe.
Ideally, on /wp-signup.php, it would be best if the blogname field doesn’t even display.
Is there a way to do this without PHP customization? I was hoping a plugin would already exist, but I can’t find one.
Looking at the source of
wp-signup.php
, it looks like your best bet might be to filtersignup_blog_init
(line 303 in v. 3.5.1):I’m not 100% sure this will work, but it’s worth a try.
Edited
OK, after your comment below, I took a look at
validate_blog_signup()
. It callswpmu_validate_blog_signup()
, and that provides a filter —wpmu_validate_blog_signup
. Looking at the code, it appears that something like the following should work:If I’m reading the code right, you can filter:
domain
path
blogname
blog_title
user
errors