asp_file_contents_before_tokenize

This filter runs just before the attachment file contents are processed and cleared from HTML etc.., before it is passed to the tokenization process.

apply_filters('asp_file_contents_before_tokenize', $contents, $post);

Parameters

  • $contents(string) - the post content

  • $post(WP_Post) - post type object (media library item)

add_filter( 'asp_file_contents_before_tokenize', 'asp_change_post_field_index', 10, 2 );
function asp_change_post_field_index( $contents, $post ) {
return $contents. " my text";
}