CRED plugin provides an API, making it easy to customize your post or user forms. The API includes hooks (actions and filters) to accomplish specific tasks using PHP code.
When you ask for help or report issues, make sure to tell us all related information about your form and what you want to achieve.
Viewing 15 topics - 481 through 495 (of 507 total)
Problem: I have a Form that allows Users to create child posts. The Form contains a select field that allows the User to select a parent post in a one-to-many relationship. Instead of displaying the parent post title in each select field option, I would like to display the post ID. Or, I would like to automate the parent post title so that the title is the same as the post ID. Parent posts are also created by Forms.
Solution: If you want to automatically set the parent post's title to be the same as its ID you could use the cred_save_data hook with your parent post Form. Remove the title field from the parent post Form first to prevent the User from submitting a title. Then use the cred_save_data hook and the wp_update_post API to programmatically set the post title.
Problem:
How to remove specific tags assigned to post when saving a post with a form?
Solution:
You can use the Toolset Form hook that runs after the post is saved cred_save_data and use the wp_remove_object_terms() function to delete the specific post_tag.
Problem:
Create child with cred form, assigning it to correct parent given by view-item
Solution:
You can use the Form's API hook "cred_save_data" in order to perform any customization after you save the post and to connect the post, you can use the post-relationship API function: toolset_connect_posts
In the "post-new-deal" form, I have a field for the featured image of the post. I would like to default the value to the featured image of the Lodge post.
Solution:
In this case, you might consider custom codes, for example: