Adds a new filter hook 'um_allow_frontend_image_uploads'

This filter hook modifies the validation of authorization on image
uploads
This commit is contained in:
champsupertramp
2016-09-21 14:08:15 +08:00
parent f52650fd51
commit a0d30ea284
+3 -1
View File
@@ -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') );
}