alagoa
Forum Replies Created
-
Above is the snippet i deleted to cause badgeos community add-om to function as expected
`function RemoveAddMediaButtonsForNonAdmins(){
if ( !current_user_can( ‘manage_options’ ) ) {
remove_action( ‘media_buttons’, ‘media_buttons’ );
}
}
add_action(‘admin_head’, ‘RemoveAddMediaButtonsForNonAdmins’);
function remove_medialibrary_tab($tabs) {
if ( !current_user_can( ‘administrator’ ) ) {
unset($tabs[“mediaLibraryTitle”]);
}
return $tabs;
}
add_filter(‘media_view_strings’, ‘remove_medialibrary_tab’);
/**
* Allow access to own content only
*/
function my_authored_content($query) {//get current user info to see if they are allowed to access ANY posts and pages
$current_user = wp_get_current_user();
// set current user to $is_user
$is_user = $current_user->user_login;//if is admin or ‘is_user’ does not equal #username
if (!current_user_can(‘manage_options’)){
//if in the admin panel
if($query->is_admin) {global $user_ID;
$query->set(‘author’, $user_ID);}
return $query;
}
return $query;
}
add_filter(‘pre_get_posts’, ‘my_authored_content’);Thanks for all your help. I have been able to isolate the problem this morning. When I deleted all the code snippets in my Site-Specific Plugin, the problem disapperared. I have reinstated the codes. However, I now know where the problem is and will isolate the particular code causing this error at my own time. Once again, thanks for all your help. I do really appreciate it.
- This reply was modified 8 years, 7 months ago by alagoa.
Many thanks. Login details sent for server and website.
Thanks for a quick response. I am using WordPress version 4.8.2. I am also using a woocommerce child theme called NOVA wp.
I have several plugins including woocommerce, geodirectory, members etcI will list the things I have tried:
1. I have changed theme to twenty-sixteen with the problem persisting.2. I have disabled all plugins but buddypress, Badgeos and the community add-on. No change
3.i have network disabled the above plugins. No luck.
What happens!
Everything works perfectly for logged out users and logged in administrators. However, once a user (with WordPress role other than admin ) is logged in , the achievement tab on buddypress profile shows “”No completed to display at this time.””.After logging out and refreshing the page, everything displays as expected. A bit strange I must confess. I can provide admin login details for you to check it if you tell me how to send it.
Many thanks for your help.
Thanks Wooninjas. Already done that. No difference. Please, help cheers