Skip to content

Commit e472ce5

Browse files
Fixed invalid file type issue
1 parent da39742 commit e472ce5

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

assets/js/bulk-featured-image-admin.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jQuery( document ).ready(
4343
bfi_remove_loader( currentobj );
4444
} else {
4545
bfi_remove_loader( currentobj );
46-
alert('The default image cannot be removed. Please upgrade to the PRO version to access this feature.');
46+
alert(bfie_object.removeDefaultMsg);
4747
}
4848
}
4949
);
@@ -129,7 +129,7 @@ function bfi_drag_drop(event, id='') {
129129
var errorMsg = document.createElement("div");
130130
errorMsg.style.color = "red";
131131
errorMsg.style.fontWeight = "bold";
132-
errorMsg.innerText = "Invalid file type! Only JPG, JPEG, and PNG are allowed.";
132+
errorMsg.innerText = bfie_object.invalidFileType;
133133
preview.appendChild(errorMsg);
134134

135135
removeImageButton.hide();
@@ -150,13 +150,12 @@ function bfi_drag( event, id ='') {
150150
if ( parseInt( id ) > 0 ) {
151151
upload_file += '_' + id;
152152
}
153-
//document.getElementById(upload_file).parentNode.className = 'draging dragBox';
153+
154154
}
155155

156156
function bfi_drop( event, id ='') {
157157
var upload_file = 'bfi_upload_file';
158158
if ( parseInt( id ) > 0 ) {
159159
upload_file += '_' + id;
160160
}
161-
//document.getElementById(upload_file).parentNode.className = 'dragBox';
162161
}

includes/class-bulk-featured-image.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ public function enqueue_admin_scripts() {
139139
array(
140140
'ajax_url' => admin_url( 'admin-ajax.php' ),
141141
'delete_post_message' => __('Are You sure you want to Remove this Image!','bulk-featured-image' ),
142+
'invalidFileType' => __('Invalid file type. Only JPG, JPEG, or PNG files are allowed.','bulk-featured-image' ),
143+
'removeDefaultMsg' => __('The default image cannot be removed. Please upgrade to the PRO version to access this feature.','bulk-featured-image' ),
142144
)
143145
);
144146
}

0 commit comments

Comments
 (0)