29 lines
1.5 KiB
Markdown
29 lines
1.5 KiB
Markdown
---
|
|
title: "WordpressMu: Don’t allow new blogs"
|
|
kind: article
|
|
slug: wordpressmu-dont-allow-new-blogs
|
|
created_at: 2006-10-31
|
|
tags:
|
|
- General
|
|
- Everything
|
|
- Features
|
|
- WordPressMu
|
|
---
|
|
If you're using <a href="http://mu.wordpress.org">WordpressMu</a>, the blog hosting tool used on <a href="http://www.wordpress.com">Wordpress.com</a>, you may want to disable the creation of blogs by your visitors.
|
|
|
|
Whatever your reasons for this are, I wanted to prevent this, because I (and my team of editors) want to maintain several blogs on different topics. Users are free to register and post comments, but creating new blogs is reserved for the administrator.
|
|
|
|
So, how do you implement this in WordpressMu? There is no checkbox (yet) that disables this feature. So, I had to hack the WordpressMu code a bit.
|
|
~
|
|
First, open up wp-signup.php. If you access a blog that does not exist, you'll be redirected to the signup page and be presented a signup form for that particular blog.
|
|
|
|
Open up wp-singup.php en just above the get_header(); call, place the following code:
|
|
|
|
:::php
|
|
if (!is_user_logged_in() || $user_identity != 'admin') {
|
|
header("Location: http://example.com/gofishatthispage/");
|
|
exit();
|
|
}
|
|
|
|
What this does is make sure that only a logged in user named 'admin' is allowed to proceed to the blog creation form. Others will be redirected to a location of your choice. A good idea is to send people to a page that explains why they can't' create a blog or what they have to do to get an administrator to create one for them.
|