I have two post types. Projects (Parent) and Proposals (Child).
I have created a view that gets the values of all users who have submitted a proposal by getting the post authors of all proposals that have been submitted. (see screenshot)
I have also created a CRED form with a generic select field that is using the view results as the value options. This CRED form is used to ‘Hire’ someone who has submitted a proposal. (see screenshot)
The form is placed on the project content template and when submitted it will edit the ‘Hired’ field for the project that is being viewed.
The only problem I am having is that I am unable to filter out the users that are displayed in the view that is being used to populate the select field.
Currently, it shows every user that has submitted a proposal on the site. I am trying to change this so it only shows users that have submitted a proposal for the project that a user is viewing.
Here’s a couple of things that I’ve tried:
1. I’ve added the following query filter to the view: Select posts that are children of… Post where this View is shown. I’ve placed this into the cred form which is then placed in the content template for projects. I’ve also placed the view directly into the content template and it still doesn’t work
2. For the proposal post type, I’ve created a field that gets the Post ID of the parent project. I used the wpv-conditional shortcode to see if the listing id field of the proposal in the loop and the post id of the current page matched and wrapped it around the view. This also did not work. If I place these two fields in the view, I can see that they match for some and not for others, but when I place them in the wpv conditional shortcode, they no longer work. Please see shortcode below.
[wpv-conditional if=“( $(wpcf-listing-id) eq '[wpv-post-id id=“$current_page"]' )”]
…..
[/wpv-conditional]
Any help or ideas you can provide will be greatly appreciated. Please let me know if you have any questions.