Problem: I have a Form that creates child posts. If the featured image is not provided in the child post Form, I would like to copy the featured image from the parent post into the featured image of the child post.
Solution: If the parent post is not predefined, then you must use the Forms API to copy the parent post's featured image into the child post's featured image since the parent post cannot be determined at the time the Form is loaded. Use the cred_submit_complete API to automate the process. In that callback you can use toolset_get_related_post or toolset_get_related_posts to query the parent post, then get_post_meta to fetch the featured image, then update_post_meta in the child post to set the featured image programmatically.
Problem: I have two custom post types - Articles and Authors - connected in a many-to-many (m2m) post relationship. I have created a View of Articles posts, and in the list of Articles I would like to include information about the related Author.
Solution: Any time you want to display information from the "many" side of a post relationship, you'll need a View. Since the relationship between Articles and Authors is a many-to-many relationship, you'll need a nested View structure to display a list of Articles and the related Authors for each Article.
Nested View creation is not directly supported in the Block Editor, so you can use the legacy View editor if necessary. For the inner View, use a post relationship Query Filter configured with the Articles - Authors M2M relationship selected, showing items as related to the current post. You can place the inner View in the loop of the outer View using a wpv-view shortcode.
Problem:
The problem here is that the user is experiencing a few issues with the previous version of Toolset and wordpress 5.8
Solution:
We recently released our Latest version of Toolset which should resolve this issue.
The plugins can be downloaded from the link below. https://toolset.com/download/toolset-blocks/
The issue here is that the user is getting the message "Deprecated: block_categories is deprecated since version 5.8.0!"
Solution:
This has since been resolved in the Latest versions of our Toolset plugins.
To update the plugins go to Plugins -> Add New -> Commercial and then scroll to the Toolset plugins table. From there you should see the option to download the plugin updates.
Problem: I have two custom post types in a one-to-many post relationship. Province is the parent (one) and District is the child (many). I would like to generate an export CSV that includes each District title and its parent Province title.
Solution: Go to wp-admin > All Export > New Export. The first step is to choose a specific post type, and choose District as that post type. Then click "customize export file" to move on to the next step. Usually ID, Title and Content are already in place in the builder. You can drag the ID and Content blocks out of the box since you don't want to include those items.
Next click "Add Field" below the builder area to add a new custom column for the Province Title. Choose the option to select a field to export, and select the ID field. You may need to reset the column name information after choosing the ID field. Check the checkbox to export a value from a PHP function, type prov_parent_title in the function name field, and paste this function in the function editor to define the custom prov_parent_title function: