Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Forum: Plugins
    In reply to: [MediaPress] Permissions
    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.
    Thread Starter hd226

    (@hd226)

    Nevermind, disregard this, just realized they used a widget area, my brain goes dead sometimes… lol

Viewing 2 replies - 1 through 2 (of 2 total)