• Using WP with buddypress plugin… mediapress version 1.0.7

    Having trouble getting the sitewide gallery permissions working the way I want them, I only have the sitewide gallery enabled but it seems only I can upload to it since im the Super-admin, how can I enable normal users to upload. I want all registered members to be able to upload. I have already enabled the ‘can_upload’ permission for all members both in wordpress and buddypress.

    Commenting permissions are working though…

    But I don’t want to use the ‘user’ or ‘group’ galleries…

Viewing 1 replies (of 1 total)
  • Thread Starter hd226

    (@hd226)

    I did try

    function mpp_custom_user_can_upload_photo() {
    	return  current_user_can( 'upload_files' );
    }
    
    function mpp_custom_upload_permission( $can_do, $component, $component_id, $gallery ) {
    
    	if ( empty( $gallery ) ) {
    		return $can_do;//do not change the permission
    	}
    
    	$type = $gallery->type;
    
    	if ( $type == 'photo' && ! mpp_custom_user_can_upload_photo() ) {
    		$can_do = false;
    	}
    
    	return $can_do;
    }
    
    add_filter( 'mpp_user_can_upload', 'mpp_custom_upload_permission', 10, 4 );

    but doesn’t seem to work. The code is modified from another topic ‘Role Based Permissions

    • This reply was modified 7 years, 10 months ago by hd226.
Viewing 1 replies (of 1 total)
  • The topic ‘Permissions’ is closed to new replies.