4
votes
Wordpress roles - Protect administrator role
It's a bit different in WP than in Drupal. First, the admin role is specifically designed to be the role that can do everything. Rather than try to restrict the admin role, it's best practice to ...
4
votes
Custom Roll/Custom Post Type - Can't Select Categories
I had the same problem, a custom role couldn't assign categories to my CPT.
When doing register_taxonomy(), I added these capabilities:
'capabilities' => array (
'...
3
votes
Accepted
Private member page
You can do it without plugins, you just have to allow subscribers to see Private posts and pages, depending on what you want, so you have to put this code in your functions.php
$subRole = get_role( '...
2
votes
Accepted
Showing content to specific BuddyPress Member Types
Your answer is on the codex page link in your question.
// Get the member type of user 5412.
$member_type = bp_get_member_type( 5412 );
So you could do something like this:
$member_type = ...
2
votes
Wordpress roles - Protect administrator role
This is a perfect use for the map_meta_cap filter.
function my_map_meta_cap( $caps, $cap, $user_id, $args ) {
if( 'delete_user' !== $cap ) {
return $caps;
}
if( isset( $args[0] ) && ...
1
vote
one time visit to the page
Although this is not a WP question, it could be done with some PHP/MySQL code. Just the psuedocode:
generate a GUID value on each main page visit
check if the GUID is already in the GUID database
if ...
1
vote
Hiding posts from non logged in users
Use this code on your child theme’s functions.php file..
//Hide for non-logged-in users (public visitors)
function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && ...
1
vote
Hiding posts from non logged in users
Fiddling with user roles would probably be the most robust solution, however a quick and dirty approach would be to set post meta-data to mark posts that should be hidden, then add a meta-query to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
members × 69user-roles × 15
plugins × 11
membership × 11
buddypress × 9
plugin-members × 8
users × 6
user-registration × 6
user-access × 5
custom-post-types × 4
posts × 4
pages × 4
login × 4
dashboard × 4
password × 4
php × 3
customization × 3
multisite × 3
capabilities × 3
content-restriction × 3
functions × 2
shortcode × 2
url-rewriting × 2
taxonomy × 2
search × 2