Indexing Shortcodes within custom field contents
How to index shortcode contents, which are within custom field contents.
Last updated
add_filter(
'asp_post_custom_field_before_tokenize',
function ( $values, $the_post, $field ) {
$field_name = 'field_name';
// Do not change anything below
$new_values = array();
if ( $field === $field_name ) {
foreach( $values as $value ) {
$new_values[] = do_shortcode($value);
}
}
return $new_values;
},
10,
3
);