From a0d30ea284207bebe577f4af5d49d8ce09f4a5e5 Mon Sep 17 00:00:00 2001 From: champsupertramp Date: Wed, 21 Sep 2016 14:08:15 +0800 Subject: [PATCH] Adds a new filter hook 'um_allow_frontend_image_uploads' This filter hook modifies the validation of authorization on image uploads --- core/um-files.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/um-files.php b/core/um-files.php index 511a5dea..14fec57e 100644 --- a/core/um-files.php +++ b/core/um-files.php @@ -537,7 +537,9 @@ class UM_Files { wp_die( __('Unauthorized to do this attempt.','ultimatemember') ); } - if ( !is_user_logged_in() && ( $key == 'profile_photo' || $key == 'cover_photo' ) ) { + $allow_frontend_image_uploads = apply_filters('um_allow_frontend_image_uploads', false, $user_id, $key ); + + if ( $allow_frontend_image_uploads == false && !is_user_logged_in() && ( $key == 'profile_photo' || $key == 'cover_photo' ) ) { wp_die( __('Unauthorized to do this attempt.','ultimatemember') ); }