CRED plugin allows you to build forms that create child posts and set parents for these posts, supporting the parent-child relationship functionality from Types plugin.
When you ask for help or report issues, make sure to tell us the structure of your content and the relationship between the content types.
Viewing 15 topics - 586 through 600 (of 620 total)
The issue here is that the user wanted to know if its a good idea to use CRED to do a quote system.
Solution:
If CRED was to be used to do this it would be a bit tricky because if you're requesting a quote the user must reference the product that they are requesting the quote for.
However are you using a custom woocommerce page template ? Because what you can do is to set the Product CPT as the parent of your quotes/inquiry cpt.
The issue here is that when the user is migrating their relationships to the new API format they are getting errors in the migration log.
> Cannot return the number of found rows because the query was not instructed to obtain them.
> Cannot return the number of found rows because the query was not instructed to obtain them.
> Unable to migrate an association from post #0 to #10461 to a relationship : Unable to load posts 0 (0).
Solution:
This issue was actually fixed in our Types 3.0.2 version, if you're experiencing this issue I would recommend updating to this version of Types.
Problem: I have a Form that allows Users to select a parent post, and I would like to filter the list of parent post options. Then I would like to associate the two posts using custom code.
Solution: You can do this with a generic field, the cred_save_data API, and the toolset_connect_posts API. You must be sure to set the generic field to use the option "persist":1, like this:
You can access a generic field value in the $_POST superglobal during the cred_save_data callback. You won't have access to the new post's ID in the cred_before_save_data callback. The new post hasn't been created yet, so no id yet. You'll need both post IDs to connect them in a relationship, so you will use cred_save_data instead. If your field has the name "custom-parent-field" then your callback would look like this:
add_action('cred_save_data', 'cred_custom_callback_fn',10,2);
function cred_custom_callback_fn($post_id, $form_data)
{
$forms = array( 1234 );
// if a specific form
if (in_array($form_data['id'], $forms))
{
if (isset($_POST['custom-parent-field']))
{
$parent_id = $_POST['custom-parent-field'];
$parent = toolset_connect_posts( 'relationship_slug', $parent_id, $post_id );
// your other callback code continues here
}
}
}
Replace custom-parent-field with the name of your generic field. Replace 1234 with the ID of the Form, or a comma-separated list of Form IDs if you want to apply this same logic to more than one Form. Replace relationship_slug with the actual slug of this relationship.
Problem: I have a Form that triggers an email notification. I send the notification to an email address that is stored in a parent post's custom field, by using the CRED API cred_notification_recipients. Since updating to Types 3.0, the email notifications are not sent as expected.
Solution: Update the code to work with the new Post Relationships API, and ensure the child post status is not "private".
Editing Existing Connections between Related Posts and using the Albums/Songs (Beatles - Revolver) examples with the intermediary post type tracks.
if I set up a view based on the intermediary post type tracks I can order by the track number but when I add the relationship form for editing the intermediary field track number I get the following message:
The items in the conection are not actually connected
Solution:
You need to edit the post relationship(between "Albums" and "Songs") within a "Songs" post.