Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › VTT Files in Attachment Search › Reply To: VTT Files in Attachment Search
January 13, 2024 at 7:06 pm
#46593
Keymaster
Oh, the file may be parsed very well, the code just does not include that part, try this:
add_filter('asp_index_file_custom_parse', 'asp_index_file_custom_parse_vtt', 10, 2);
function asp_index_file_custom_parse_vtt($text, $post) {
if ( $post->post_mime_type == 'text/vtt' ) {
$content = file_get_contents(get_attached_file( $post->ID ));
update_post_meta($post->ID, '_asp_attachment_text', $content);
return $content;
}
return '';
}
If all goes well, then after indexing it should show the file contents.