Home › Topic Tag: CRED API
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.
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
How to reduce a different users custom user field value by 1 after submitting
Started by: KeithM7209 in: Toolset Professional Support |
|
2 | 4 | 4 years, 1 month ago | |
Calculated value for a Custom Field saving a Custom Type Post
Started by: alessandroD-7 in: Toolset Professional Support |
|
2 | 2 | 4 years, 1 month ago | |
How to create a unique reference number and use it as CPT post title
Started by: KeithM7209 in: Toolset Professional Support |
|
2 | 4 | 4 years, 2 months ago | |
What is the URL naming convention for posts created with CRED forms?
Started by: PaulS4783 in: Toolset Professional Support |
|
2 | 3 | 4 years, 2 months ago | |
Establish a one to many relationship between a post type and users
Started by: danielJ-10
in: Toolset Professional Support
Problem: I would like to create a one-to-many relationship between Users and a post type. Solution: You can either create a proxy post type for Users and relate that proxy post type using Toolset's Post Relationships feature, or you can create a custom usermeta field that stores a reference to the related post by ID. Relevant Documentation: |
|
2 | 8 | 4 years, 2 months ago | |
Conditionally display the "add new" for repeating fields in post forms
Started by: Don in: Toolset Professional Support |
|
2 | 11 | 4 years, 2 months ago | |
PAID Featured Post Integration or Recommendation
Started by: Don
in: Toolset Professional Support
Problem: I would like to provide visitors the ability to create both free and paid posts on the front-end of the site using Forms. Solution: In the current software this requires two Forms - one for free posts and another for paid posts. A more custom solution that provides both options in a single form will require custom code. Relevant Documentation: |
|
3 | 13 | 4 years, 2 months ago | |
I need to set the visible size of an input field in a CRED form
Started by: jeffS-2 in: Toolset Professional Support |
|
2 | 4 | 4 years, 2 months ago | |
Array to String Conversion Error When Image Size Validation Fails
Started by: julieP
in: Toolset Professional Support
Problem: The cred_form_validate filter hook throws PHP waring in editing post form. Solution: This is fixed in next version of Toolset Forms plugin. Relevant Documentation: |
|
2 | 10 | 4 years, 2 months ago | |
How to restrict a frase or domain in Cred post form
Started by: Tiit Sau
in: Toolset Professional Support
Problem: Solution: You can find the proposed solution in this case with the following reply: Relevant Documentation: |
|
2 | 6 | 4 years, 2 months ago | |
Modifying Form Select Fields with Select2 not Working
Started by: Don in: Toolset Professional Support |
|
2 | 8 | 4 years, 2 months ago | |
Capture the distance between two points and save to custom field
Started by: stuart
in: Toolset Professional Support
Problem: I have two address fields, one in a parent post type and one in a child post type. When a new child post is created, I would like to calculate the distance between the two addresses and save that distance in another custom field in the child post type. Solution: You can use the cred_submit_complete hook to trigger custom code with the shortcode toolset-maps-distance-value to calculate the distance between two addresses. Use the update_post_meta function to store that distance in another custom field. add_action('cred_submit_complete', 'tssupp_calc_parent_child_distance',10,2); function tssupp_calc_parent_child_distance($post_id, $form_data) { $forms = array(123, 456); $relationship_slug = 'book-chapter'; $parent_address_slug = 'book-address-1'; $child_address_slug = 'chapter-address-1'; $child_distance_slug = 'chapter-single-line-1'; $unit = 'km'; $decimals = 2; // if a specific form if ( in_array( $form_data['id'], $forms ) ) { $related_post = toolset_get_related_post( $post_id, $relationship_slug, 'parent' ); if( $related_post ) { $child_location = get_post_meta( $post_id, 'wpcf-'.$child_address_slug, true ); $parent_location = get_post_meta( $related_post, 'wpcf-'.$parent_address_slug, true ); if( $child_location && $parent_location ) { $distance = do_shortcode("[toolset-maps-distance-value location='" . $child_location . "' postmeta='wpcf-". $parent_address_slug . "' postmeta_id='" . $related_post . "' unit='" . $unit . "' decimals='" . $decimals . "']"); update_post_meta( $post_id, 'wpcf-'.$child_distance_slug, $distance ); } } } } Relevant Documentation: |
|
2 | 6 | 4 years, 2 months ago | |
How to load a specific custom post into a post form after submitting a form
Started by: KeithM7209 in: Toolset Professional Support |
|
3 | 4 | 4 years, 2 months ago | |
Multi select custom field
Started by: sophieN in: Toolset Professional Support |
|
2 | 2 | 4 years, 2 months ago | |
Post expiration date in form doesn’t work anymore
Started by: katjaL
in: Toolset Professional Support
Problem: Solution: https://toolset.com/forums/topic/post-expiration-date-in-form-doesnt-work-anymore/#post-2072441 Relevant Documentation: |
|
2 | 15 | 4 years, 2 months ago |