The Donor Dashboard is a feature of GiveWP with which donors can view their donation history, download donation receipts, and manage recurring donations. It also features an editable profile, including a donor avatar.
The avatar feature includes a file upload field because WordPress user accounts do not natively support custom avatars. However, sites with active security threats may opt to disable file uploads on their site. The GiveWP Donor Dashboard avatar upload is easily disabled using the following snippet.
add_action('give_embed_head', function() {
echo '
<style>
/* Hide the avatar and upload form. */
.give-donor-dashboard-avatar-control,
.give-donor-dashboard-donor-info__avatar {
display: none !important;
}
.give-donor-dashboard-donor-info {
display: block !important;
}
</style>
';
});
add_filter('rest_endpoints', function($endpoints) {
// Remove the Donor Dashboard avatar upload route.
unset($endpoints['/give-api/v2/donor-dashboard/avatar']);
return $endpoints;
});