Skip to content

Commit 5efb5cf

Browse files
Changes in success message
1 parent dd57ed9 commit 5efb5cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

admin/class-bulk-featured-image-settings-fields.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ public function save_post_types() {
149149
$setting_key = 'bfi_settings';
150150
$bfi_settings = get_option( $setting_key, true );
151151

152+
$message_updated = false;
152153
if( isset( $_FILES['bfi_upload_file'] ) && !empty( $_FILES['bfi_upload_file'] ) && is_array($_FILES['bfi_upload_file'])) {
153154
$image_url = !empty( $_FILES['bfi_upload_file']['tmp_name'] ) ? sanitize_text_field( $_FILES['bfi_upload_file']['tmp_name'] ) : '';
154155
$image_name = !empty( $_FILES['bfi_upload_file']['name'] ) ? sanitize_text_field( $_FILES['bfi_upload_file']['name'] ) : '';
@@ -159,6 +160,7 @@ public function save_post_types() {
159160

160161
if( !empty($attach_id) && $attach_id > 0 ) {
161162
$settings['bfi_upload_file'] = (int)sanitize_text_field($attach_id);
163+
$message_updated = true;
162164
}
163165
}
164166
}
@@ -208,9 +210,12 @@ public function save_post_types() {
208210

209211
update_option( $setting_key, $bfi_settings );
210212

211-
self::add_message( sprintf(__( 'Your <strong>%s</strong> featured image updated successfully.', 'bulk-featured-image' ), ucwords($current_sub_section) ) );
213+
if( $message_updated ) {
214+
self::add_message( sprintf(__( 'Your <strong>%s</strong> featured image updated successfully.', 'bulk-featured-image' ), ucwords($current_sub_section) ) );
215+
}
212216
}
213217

218+
214219
public function add_default_post_type_thumb( $section ) {
215220

216221
if( empty($section) ) {

0 commit comments

Comments
 (0)