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.