I have 4 "Many to many" relationships, all connecting to my custom AHHA-Author post type:
many AHHA-Authors <---connected to---> many Self-Help-Videos
many AHHA-Authors <---connected to---> many Self-Help-Articles
many AHHA-Authors <---connected to---> many Self-Help-Tools
many AHHA-Authors <---connected to---> many Spiritual-Books
I'm creating a search page to search through the "Self-Help-Articles" post-type.
I want to search by Last Name of the "AHHA-Author" post-type, that is connected to the "Self-Help-Article".
I used the "New Filter" button to add this code to the search/view:
[wpv-control-post-relationship ancestors="ahha-author@ahha-author-self-help-article.parent" url_param="wpv-relationship-filter"]
<div class="form-group">
<label for="wpv-relationship-filter">[wpml-string context="wpv-views"]Search specific authors[/wpml-string]</label>
[wpv-control-post-ancestor type="select" ancestor_type="ahha-author@ahha-author-self-help-article.parent"]
</div>
[/wpv-control-post-relationship]
But instead of getting JUST "AHHA-Authors" of "Self-Help-Articles", I see in the list ALL "AHHA-Authors" of all 4 of the connected custom post types.
You can see it happening here:
hidden link
If you select: "AlHajri, Faris, Ph.D. (A.M.)" and click Search, you'll get no results returned. This is correct because "AlHajri, Faris, Ph.D. (A.M.)" is not the author of a "Self-Help-Article", he is only the AHHA-Author or a "Self-Help-Video".
The SEARCH RESULTS work.
BUT, we don't want to see "Abdo, John, CFT" showing up in this drop down - because we only want to search by "AHHA-Authors" OF "Self-Help-Article".
Otherwise, selecting one of the AHHA-Authors, like "AlHajri, Faris, Ph.D. (A.M.)", will return NO RESULTS.
***
And of course, I'll want to do the same on the pages for the other searches of: Self-Help-Videos, Self-Help-Tools, and Spiritual-Books; We only want to see the AHHA-Authors CONNECTED to those items, not ALL AHHA-Authors of everything.