Hi,
I have my custom post forms A, B, & C all set to "Pending Review" when a user submits any of them. If someone now submits a post for CPT A, I want the user to be able to search for and select the related post in CPT B that was just added, even though it has the status of "Pending Review".
In short, I want the search/dropdown field in a CRED form where a user connects relationships to be able to display all posts, even ones that are not published and only Pending Review. This way, the user can connect a Post that they just added even though it is not Published yet (I want to review the info & approve Post myself, that's why it is set to pending). Is there a way to accomplish this?
Thanks,
Sim
Hello,
There isn't such kind of built-in feature within Toolset Forms plugin.
As a workaround, you can try these:
Create a post view:
- Query posts of "CPT A"
- Enable post status filter:
https://toolset.com/documentation/user-guides/views/filtering-views-query-by-post-status/
- Setup the custom search form
- In view's loop, display the child post form link:
https://toolset.com/course-lesson/selecting-parent-posts-when-using-forms-to-create-child-items/#creating-forms-when-a-parent-post-is-preselected
section "Creating Forms with a Parent Post Preselected"
I'm not sure if this directly answered my question? I already have a view with posts being displayed, but this is on the form page that I'm referring to. I want users that are visiting the form page to upload a post, to be able to select a related post that they just previously submitted but is currently under pending review so it isn't showing up in the dropdown option.
If the above answers this question would you be able to reiterate because I am just unsure how this helps?
Thank You,
Sim
Thanks for the details, unfortunately, there isn't such kind of built-in feature withing Toolset Forms plugin, you can add a feature request for it:
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
Currently, you can consider custom codes, for example:
1) In the Toolset post form, insert the general hidden field
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field
set the default value as the URL parameter
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-search-term
2) After user submit the form, use action hook "cred_save_data" to trigger a PHP function
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
in this PHP function, get the hidden field value, use it to connect the parent pending post with the new child post
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
My issue is resolved now. Thank you!