I have a CRED form that is used to create a child post of two parents, When creating the post the there are fields to select the parent posts.
However the parent post select is no longer being populated and I am getting the message "No results found". It was working but has stopped working with more recent CRED/TYPES updates (unsure which).
The cred field shortcode that is no longer working is [cred_field field="_wpcf_belongs_doula-profile_id" value=""]
Hi, I'll be glad to take a look. Please try the following troubleshooting steps first:
- Temporarily activate a default theme like Twenty Seventeen and deactivate all plugins except Types, Views and CRED. If you need to activate a plugin like Maintenance Mode during testing, that's fine.
- Test the CRED form again
- If the parent post titles are appearing as expected, reactivate your theme and other plugins one by one until the conflict is revealed.
- If the parent post titles are still not appearing as expected after deactivating plugins, please open the browser console and load the CRED form in your browser again. Try the parent field and watch for any JavaScript errors that appear in the console. Copy those into your next reply for me to review.
Please let me know what you find and we can go from there.
Hi,
I think I have pinned this down to a filter in my child theme's functions.php file:
add_filter('cred_get_potential_parents_post_status', '_pr_belongs_post_status');
function _pr_belongs_post_status($statuses)
{
return 'any';
}
When I remove this filter the form works.
It was working previously with this code included.
Thanks
Chris
It would seem if I replace the
with
OR with
It works. But I ideally need it to work with any status.
Thanks
Okay thanks for the additional information. Since this filter is undocumented, I am unsure about how it is supposed to work. Let me reach out to my 2nd tier support team for some additional information, and I will update you as soon as I have more details.
Okay I have been unable to reproduce this issue locally, so my 2nd tier support team has asked for a clone of your site so we can do some additional investigation. Please provide login credentials in the private reply fields here if that's okay with you, and I will install the Duplicator plugin to create that site clone.
I updated the theme's functions.php file to return an empty string in the callback function:
add_filter('cred_get_potential_parents_post_status', '_pr_belongs_post_status');
function _pr_belongs_post_status($statuses)
{
return '';
}
I'm able to find Clare Sc... (a pending profile) now in the profile parent select field. Can you confirm?
That's great - it seems to have done the trick - many thanks!