Bulk updater does not respect settings
-
Hello,
It look like the bulk updater does not respect the settings for Auto title / caption / alt : it changes every fields even if some settings are unchecked.
I suggest that you change from the line 337 of the main file, replace :
// Update the image Title, Caption and Description with the image name $updated_image = array( 'ID' => $image->ID, 'post_title' => $image_name, // Image Title 'post_excerpt' => $image_name, // Image Caption 'post_content' => $image_name, // Image Description ); wp_update_post( $updated_image ); // Update Image Alt Text (stored in post_meta table) update_post_meta( $image->ID, '_wp_attachment_image_alt', $image_name ); // Image Alt Text
by :
// Retrieve settings $settings = get_option('iaff_settings', $defaults); // Update the image Title, Caption and Description with the image name $updated_image = array( 'ID' => $image->ID, ); if ( isset( $settings['image_title'] ) && boolval($settings['image_title']) ) { $updated_image['post_title'] = $image_name; // Image Title } if ( isset( $settings['image_caption'] ) && boolval($settings['image_caption']) ) { $updated_image['post_excerpt'] = $image_name; // Image Caption } if ( isset( $settings['image_description'] ) && boolval($settings['image_description']) ) { $updated_image['post_content'] = $image_name; // Image Description } wp_update_post( $updated_image ); // Update Image Alt Text (stored in post_meta table) if ( isset( $settings['image_alttext'] ) && boolval($settings['image_alttext']) ) { update_post_meta( $image->ID, '_wp_attachment_image_alt', $image_name ); // Image Alt Text }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘Bulk updater does not respect settings’ is closed to new replies.