$post_id]; if ( ! empty( $json_alt_fields['title'] ) ) { $args['post_title'] = $json_alt_fields['title']; } if ( ! empty( $json_alt_fields['caption'] ) ) { $args['post_excerpt'] = $json_alt_fields['caption']; } if ( ! empty( $json_alt_fields['description'] ) ) { $args['post_content'] = $json_alt_fields['description']; } wp_update_post( $args ); if ( ! empty( $json_alt_fields['filename'] ) ) { AIT_IAT_Alt_Generator::maybe_rename_attachment_file( $post_id, $json_alt_fields['filename'] ); } } $updated++; } } /* translators: number of images with alt text updated */ update_option('ait_iat_admin_notice', sprintf(__('AI regenerated alt text for %d images.', 'ai-image-alt-text'), $updated)); return $redirect_to; } }