Disabled delete_others_posts if post is from admin
Disabled delete_others_posts if post is from admin
Disabled delete_others_posts if post is from admin
How to assign a role to a simple visitor?
Got it fixed. Here is the code: add_action(‘wp_head’, function(){ if(is_user_logged_in()){ $user = wp_get_current_user(); if ( in_array( ‘pre_subscriber’, (array) $user->roles ) ) { $passed = learndash_user_quiz_has_completed($user->ID, 8731, 8388); if($passed){ // Remove role $user->remove_role( ‘pre_subscriber’ ); // Add role $user->add_role( ‘subscriber’ ); } } }} );
Custom Role read_private_posts Not Working
Why can my subscribers create new posts for review?
I’m using this plugin to solve the issue – https://wordpress.org/plugins/stream/
users in their Role can only their Posts
Setting an expiration date for wordpress roles
So I ended up using a combination of the array_filter function and the in_array function to retrieve all custom roles like this: <?php function check_roles($userRole) { $default_roles = array(‘Administrator’, ‘Editor’, ‘Author’, ‘Contributor’, ‘Subscriber’); if (!in_array($userRole, $default_roles)) { return $userRole; } } $all_roles = wp_roles()->get_names(); $custom_roles = array_filter($all_roles, ‘check_roles’); foreach ($custom_roles as $role) { echo $role; … Read more
Since you’re just checking to see if they are a logged in use, you can just use the is_user_logged_in() function to check if they are logged in and if so, display the download link, if not, don’t display the download link.