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.
Continue Reading →Tips and Tricks
Add a meta box in the post editor for blocking custom post types
Users who configure to block custom post types will notice that you don’t get the meta box that WP-Members shows for blocking (or unblocking) posts and pages. While you can still use custom fields directly for custom post blocking/unblocking at the individual post level, it’s nice to have the meta box. So I’ve put together a code snippet for you to use to implement this on your custom post type editors.
Blocking Custom Post Types
Note: As of WP-Members 3.0, you can add custom post types to the plugin’s main blocking options. See the options documentation section on 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.
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. It also takes advantage of the new extra settings that WP-Members version 3.0 offers.
(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.) Continue Reading →
Customized sidebar widget
I often get questions about the filters that I use on this site for the sidebar widget. This post has the exact custom filters that I use, copy/pasted from my own functions.php file.
For those with questions about how the sidebar widget is styled, that is all CSS and a lot of it is from the Genesis Theme Framework. This post does not address that. What it does address is how I add the gravatar image and change the log out link to include “edit profile”. Continue Reading →
Make WP-Members fields in the users screen sortable
Here is a code snippet that you can use to make all of the WP-Members custom fields sortable in the Users > All Users screen.
To use this code, add the entire code snippet to your functions.php file. Any field in the WP-Members Fields tab that you have selected to display on the Users Screen will be sortable.