Send new user an activation link in the new registration email

In the past, I have put together a method for making the link in the admin notification email a single click process for activating users. But what if you want users to be sent an activation link to confirm their account and activate themselves?  This code snippet will provide a framework for you to do that.   [Read more…]

Restrict a post or a page to a specific user role – multiple select version

Similar to how we took the post/page restriction for specific users to a multiple select version, this post takes the restrict content by role idea and expands it to a multiple select version.

This is an extension of the ideas presented in the tutorial Restrict Content by Role with the twist that this version makes some minor changes to incorporate an HTML multi-select for selecting multiple roles for access to content.

The differences between these two code snippets is minimal, so I won’t actually repeat the concept in this post. But you should read the original version to get an understanding of what is being done and how it works.  This post will just highlight what’s different.   [Read more…]

Restrict Post or Page Access to Specific Users – Multiple Select Version

This is an extension of the ideas presented in the tutorial Restrict Post or Page Access to a Specific User with the twist that this version makes some minor changes to incorporate an HTML multi-select for selecting multiple users for access to a post.   [Read more…]

Blocking Custom Post Types

This is a new method of blocking custom post types. There are two main differences over the method described here and the original method I described here.

First, this method is a little more scalable.  If you have multiple custom post types and want to set a blocking value for each, you only need to add to the settings array.  Second, this method allows you to override the blocking value on an individual custom post type post than  you have set for the custom post type as a group.  This operates the same as regular posts and pages.

(If you want to add a meta box for blocking/unblocking individual custom post type posts, there is an additional code snippet you can add here.)   [Read more…]

Restrict a post or a page to a specific user role

In the past, I have put up posts about restricting content to a created user “level,” restricting content to a specific user, etc. Interestingly, we have not yet touched on the subject of restricting content by user role.

The method used here is very similar to what was done to restrict a post or a page to a specific user. In fact, that code was my starting point – it really took some minor changes. So I’ll primarily focus on what is different.

[Read more…]