tinoU
Support threads created in the last 30 days: 0
Favorite Forum Topics
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Add honeypot to CRED form
Started by: lindsayH
in: Toolset Professional Support
Problem: function loadtime_func($atts, $content) { return time(); } add_shortcode('loadtime', 'loadtime_func'); add_filter('cred_form_validate','honeypot_func',10,2); function honeypot_func($field_data, $form_data) { list($fields,$errors)=$field_data; if ($form_data['id']==123) { $loadtime = $_POST["loadtime"]; $totaltime = time() - $loadtime; if($totaltime < 7) { $errors['loadtime'] = 'Please fill in the form before submitting!'; } } //return result return array($fields,$errors); } Please replace 123 with the CRED form ID [cred_generic_field field="loadtime" type="hidden" class="" urlparam=""] { "required":0, "validate_format":0, "persist":0, "default":[loadtime] } [/cred_generic_field] Relevant Documentation: |
4 | 7 | 8 years, 2 months ago | ||
Hiding children when editing parent
Started by: kn.martynas
in: Toolset Professional Support
Problem: Solution: If you still need child repeating fields, and do not need to edit the Child from the Parent screen, you can remove Control Screen for the Child Post type in the Parent Post Edit Screen This is done in Types > Post Types > your_parent_post_type > Edit > Post relationship > the_child_post > Select Fields |
2 | 3 | 8 years, 3 months ago | ||
Automatically change a field in one type when a field in another type is changed
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: 2. Check if the Field's value is == value 3. If this is true do your custom actions. 4. This is a example code: function position_filled($post_id, $form_data) { // if a specific form if ($form_data['id']==168) //CRED Form ID { //get value of cv-status (Radio value of current CV Sent edited with CRED) $new_cv_status = get_post_meta($post_id, 'wpcf-value', true); //check if CV Status == 'Placed' if ($new_cv_status == 7) { //get ID of parent Job , which is stored in the CV Status wpcf_belongs_job_id $ID = get_post_meta($post_id, '_wpcf_belongs_parent-file_id', true); //get the parent post object $post_parent_object = get_post( $ID ); //get it's ID $ID_parent = $post_parent_object->ID; //Update the parent's post field (RADIO) update_post_meta($ID_parent, 'wpcf-value', 1); } } } add_action('cred_save_data', 'position_filled',10,2); Relevant Documentation: |
2 | 10 | 8 years, 3 months ago | ||
display custom user meta data in view
Started by: eliseD-2 in: Toolset Professional Support |
2 | 3 | 8 years, 4 months ago | ||
How to allow visitors to vote on a post with something like a star rating
Started by: jonS-4 in: Types Community Support |
2 | 2 | 8 years, 5 months ago | ||
Display Gravatar in View?
Started by: Boris in: Toolset Professional Support |
2 | 3 | 8 years, 7 months ago | ||
Repeater Field Inquiry
Started by: bassemK in: Toolset Professional Support |
2 | 3 | 8 years, 8 months ago | ||
I am trying to include StickyPosts (using original "Posts")
Started by: Justin in: Toolset Professional Support |
2 | 4 | 8 years, 11 months ago | ||
Ad package determines how many featured Ads user can create
1
2
Started by: tinoU in: Toolset Professional Support |
3 | 19 | 9 years ago | ||
Google Maps does not show on my real estate site after activating Maps for Views
Started by: tinoU in: Toolset Professional Support |
2 | 5 | 9 years, 5 months ago | ||
Add record form parent dropdown
Started by: jonH-2 in: Toolset Professional Support |
2 | 4 | 9 years, 7 months ago | ||
Auto fill parent field in CRED form
1
2
Started by: carletto0282 in: Toolset Professional Support |
5 | 19 | 9 years, 7 months ago | ||
Add decimals/format to custom field values
Started by: thomasL-2 in: Toolset Professional Support |
2 | 2 | 9 years, 8 months ago | ||
Repeating Groups of fields
1
2
Started by: Alan in: Types Community Support |
3 | 16 | 10 years, 7 months ago |
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Latest version of Types is causing Error message/brake
Started by: tinoU in: Toolset Professional Support |
2 | 2 | 3 years, 5 months ago | ||
CRED Form not sending immediately using Ajax submit
Started by: tinoU in: Toolset Professional Support |
2 | 11 | 4 years, 6 months ago | ||
Types plugin crashes wordpress admin on activation
Started by: tinoU in: Toolset Professional Support |
2 | 4 | 5 years, 7 months ago | ||
Limit the number of CRED form Submissions
Started by: tinoU
in: Toolset Professional Support
Problem: I had followed your recommendation at https://toolset.com/forums/topic/limiting-cred-form-submission-to-one-post/# I have a CRED form (ID: 1695) which creates CPT Reviews (review) of another parent CPT Shops (shop) and I want to limit the number of reviews each user on my site submits, down to one review per shop. The user roles are as follows: Role 1: Author and I would like to show the same error message. Solution: You can add an author filter into the query, for example, //Limit the number of reviews for a user on a parent CPT add_filter('cred_form_validate','my_validation',10,2); function my_validation($field_data, $form_data) { //field data are field values and errors list($fields,$errors)=$field_data; //uncomment this if you want to print the field values //print_r($fields); //validate if specific form if ($form_data['id']==1695) { $user = get_current_user_id(); $shop_id = $_POST['_wpcf_belongs_shop_id']; $args = array( 'meta_key' => '_wpcf_belongs_shop_id', 'meta_value' => $shop_id, 'post_type' => 'review', 'author' => get_current_user_id() ); $query = new WP_Query( $args ); $user_post_count = 0; if(isset($query->found_posts)){ $user_post_count = $query->found_posts; } $user_data = get_userdata($user); $user_role = $user_data->roles; if ( in_array($user_role[0], array('subscriber', 'author', 'contributor', 'editor')) && $user_post_count > 0) { //set error message for my_field $errors['wpcf-user-validation']='<span><i class="fa fa-star" aria-hidden="true"></i> You have already left a Review!</span>'; } } //return result return array($fields,$errors); } Relevant Documentation: https://codex.wordpress.org/Class_Reference/WP_Query#Author_Parameters |
2 | 9 | 6 years, 3 months ago | ||
Update Cred Fontawesome version or remove it
Started by: tinoU in: Toolset Professional Support |
2 | 3 | 7 years, 2 months ago | ||
User form notification returning blank
Started by: tinoU in: Toolset Professional Support |
2 | 5 | 8 years ago | ||
recaptcha error after user form submission
Started by: tinoU in: Toolset Professional Support |
1 | 2 | 8 years ago | ||
Add css to a cred field
Started by: tinoU in: Toolset Professional Support |
2 | 8 | 8 years, 2 months ago | ||
Updating Parent Post resets Child post custom fields
Started by: tinoU in: Toolset Professional Support |
2 | 2 | 8 years, 3 months ago | ||
CSS styling editor – where is it now?
Started by: tinoU in: Toolset Professional Support |
2 | 2 | 8 years, 7 months ago | ||
Ad package determines how many featured Ads user can create
1
2
Started by: tinoU in: Toolset Professional Support |
3 | 19 | 9 years ago | ||
Embed Types and Views – Instructions not clear
Started by: tinoU in: Toolset Professional Support |
2 | 4 | 9 years, 1 month ago | ||
What is the setup in order to set the number of featured posts tha
Started by: tinoU in: Toolset Professional Support |
2 | 11 | 9 years, 3 months ago | ||
Workaround for Google Maps Mouse Scrolling
Started by: tinoU in: Toolset Professional Support |
2 | 3 | 9 years, 3 months ago | ||
When Cred form is saved, my custom field value is reset
Started by: tinoU in: Types Community Support |
2 | 8 | 9 years, 3 months ago |