This document discusses how to build a private user access area in WordPress using custom post types, roles, and capabilities. It recommends installing plugins like User Access Manager and Capability Manager to create custom user groups, assign roles and capabilities to each group, and restrict access to specific content and functions. The process involves registering custom post types and taxonomies, creating roles to assign capabilities, and using templates and conditional statements to restrict access for different user groups.
3. Logged in Site Requirements
3 separate “blog” areas for each user group
Each group has unique editing and viewing abilities
Blog must have categories
Blog must be searchable
Media in these areas must be locked
Thursday, October 13, 2011
4. Content Restriction
Membership sites that manage
the viewing of content
Wishlist Membership Membership
MemberWing Magic Members
Thursday, October 13, 2011
5. Capabilities Restriction
Membership site that manages user
capabilities
Manages user permissions to do VARIOUS tasks by
creating custom user groups and roles, and assigning
capabilities to each
E.g User Access Manager, Members Plugin, Role
Scoper etc.
Thursday, October 13, 2011
6. What are Roles?
Roles are a set of abilities assigned to users which
control what a user can or cannot do on a site
5 default Roles: Administrator, Editor, Author,
Contributor, Subscriber
http://codex.wordpress.org/Roles_and_Capabilities
Thursday, October 13, 2011
7. What are Capabilities?
Each Role is allowed to perform a set of tasks called
Capabilities.
E.g. publish_post, moderate_comments, edit_users
etc.
Thursday, October 13, 2011
8. What are User Groups?
User Groups are different from Roles.
User Groups are arbitrary names for groupings of users
User Groups are assigned Roles and Roles are
assigned Capabilities.
Thursday, October 13, 2011
9. So....
If you can create unique roles,
then you can create unique
roles with unique capabilities!
Thursday, October 13, 2011
10. The process...
1.Install User Access Manager and Capability Manager
plugins
2.Create User Groups
3.Create Custom Post Types & Taxonomies for each
User Group
4. Create Roles and assign capabilities to each User Group
5. Create Custom Post Type Templates
6. Finishing touches
Thursday, October 13, 2011
14. Register Custom Taxonomies
Custom taxonomies have capability arguments as well.
Register your custom taxonomies with capabilities,
then assign the capabilities to specific roles as you
would with Custom Post Types.
See: http://justintadlock.com/archives/2010/06/10/a-
refresher-on-custom-taxonomies
Thursday, October 13, 2011
20. Create your Custom Post
Type Templates
Create archive-posttypename.php and single-posttypename.php
Thursday, October 13, 2011
21. Custom Sidebars
In your archive-posttypename.php file you may want to
place in custom sidebars with you corresponding
Taxonomies.
Or you can create a custom widgetized sidebar for
each of your archive-post-typename.php
Thursday, October 13, 2011
22. Conditional Statements
Use conditional statements with particular user
capabilities to create unique instances for each role.
if ( current_user_can
( 'edit_directors' ) ) {
// do something
}
Thursday, October 13, 2011
23. Re-direction
User Access Manager has the ability for you to assign a
particular page to redirect a User Group once logged
in.
Redirect plugin also does this (e.g. Peter’s Login
Redirect plugin)
Thursday, October 13, 2011