This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: VTT Files in Attachment Search

#46593
Ernest MarcinkoErnest Marcinko
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.