Hi! I have a content type, Location, with a repeatable field group, Unique Feature. I want the content of the repeatable field group to show up in the site search - so if location East Regional has a garden feature, if someone searches for garden, East Regional should show up in the results.
I contacted Relevanssi support to ask how to do this, and they said I can add a filter to index the features like this:
add_filter('relevanssi_content_to_index', 'add_extra_content', 10, 2);
function add_extra_content($content, $post) {
[function to get feature content here]
}
(Here's their KB article about it if that helps: hidden link).
Can you tell me, or point me to documentation about, how to put together a function that will get repeatable field group content for a given post?
Thanks!
Hello,
The repeatable field groups are based on one-to-many post type relationship, so each repeatable field group item is also a single post, you can follow our document to get related items of repeatable field group in a single post:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/how-to-migrate-your-site-to-new-post-relationships/#new-approach
Notice:
In your PHP codes, you can use repeatable field group slug as the relationship slug.