asp_index_cf_contents_before_tokenize
Gives access to all of the custom field content merged into a string, before they are sent to tokenization
apply_filters('asp_post_custom_field_before_tokenize', $field_contents, $the_post);
- $field_contents (string) - contents of all the custom fields merged as a string
- $post (WP_Post) - post type object
The return value should always be an string
add_filter( 'asp_post_custom_field_before_tokenize', 'asp_change_cf_index', 10, 3 );
function asp_change_cf_index( $field_contents, $post ) {
if ( $field_contents == '' ) {
return 'my custom field contents';
} else {
return $field_contents;
}
}