gavinS
Support threads created in the last 30 days: 0
Favorite Forum Topics
This user has no favorite topics.
Forum Topics Created
Status | Topic | Supporter | Voices | Posts | Freshness |
---|---|---|---|---|---|
Use repeating field values as options for a field on a CRED form
Started by: gavinS in: Toolset Professional Support |
2 | 6 | 7 years, 11 months ago | ||
Filter by custom date field to find posts from within the current month
1
2
3
Started by: gavinS in: Toolset Professional Support |
3 | 35 | 8 years ago | ||
Conditional comparing current user meta to author meta
Started by: gavinS in: Toolset Professional Support |
2 | 2 | 8 years ago | ||
Modify date upon save
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: Please check this answer: https://toolset.com/forums/topic/modify-date-upon-save/#post-374533 Relevant Documentation: |
2 | 8 | 8 years ago | ||
Same filter produces different results on different views
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: What is sure, your URL's will not work with double apostrophes. "" Example which will break: <a href = "http://site.com/page/?author-filter=[wpv-user field="user_login"]&toc=1">Emails:</a> Example which can work: <a href = "http://site.com/page/?author-filter=[wpv-user field='user_login']&toc=1">Emails:</a> |
2 | 6 | 8 years, 1 month ago | ||
Trying to display parent post link, but child link is shown
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: 1. The Parent Post information you want to display is not existent or not connected to the Child Post queried in the View After reviewing the above mandatory settings, you can avoid to fallback to the Currently Queried Post's field by evaluating first if the Parent Field exists. Relevant Documentation: |
2 | 4 | 8 years, 1 month ago | ||
Something strange happening with a count of posts
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: So it needs custom codes with Views filter hook to apply such a filter, I added below codes into your theme/functions.php: // https://toolset.com/forums/topic/something-strange-happening-with-a-count-of-posts/ add_filter( 'wpv_filter_query', 'my_date_filter_func', 99, 3 ); function my_date_filter_func( $query_args, $settings, $views_id ) { if ( $views_id == 1555 ) { if(isset($query_args['date_query'][0]['day'])){ $query_args['date_query'][0] = array( 'after' => $query_args['date_query'][0]['day'] . ' days ago', 'column' => 'post_date_gmt', ); } } return $query_args; } Relevant Documentation: |
2 | 13 | 8 years, 1 month ago | ||
View stopped working after cloning
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: |
2 | 10 | 8 years, 1 month ago | ||
Nested view with conditional sums
Started by: gavinS
in: Toolset Professional Support
Problem: $value += $result Solution: global $total; function add_total_shortcode($atts, $content = '') { global $total; $total += wpv_do_shortcode($content); } add_shortcode('add-to-total', 'add_total_shortcode'); function show_total_shortcode() { global $total; $totalNew = $total; $total = 0; return $totalNew; } add_shortcode('show-total', 'show_total_shortcode'); Register those ShortCodes in Views > Settings > Compatibility > 3rd Party ShortCodes use the ShortCodes in a View as this: <wpv-loop> [types field="your-numeric-field" output="raw"][/types] [add-to-total] [types field="your-numeric-field" output="raw"][/types] [/add-to-total] </wpv-loop> [show-total] |
2 | 11 | 8 years, 2 months ago | ||
Record when changes are made to a certain field
Started by: gavinS
in: Toolset Professional Support
Problem: Solution: 2, This is a example code, fully commented: function record_status_change($form_data) { // if a specific form if ($form_data['id']==168) //CRED Form ID { //get existing post id $existing_post_id = $form_data['container_id']; //Current CONTAINER of Form (current Post) //https://toolset.com/documentation/user-guides/cred-api/#cbsd //get existing post field value $existing_post_status = get_post_meta($existing_post_id, 'wpcf-value', true); //Get post meta value of currnet post //get new field value $new_field_value = $_POST['wpcf-value']; //get value of current CRED Form field //If value has changed if ($existing_post_status != $new_field_value) //if this is not the same { //if, then insert the new post //values please refer to this DOC: //https://codex.wordpress.org/Function_Reference/wp_insert_post //I already put in a few examples, it's to adapt. Please read the WP Codex carefully for debug. $new_post = array( 'post_content' => '', 'post_excerpt' => '', 'post_name' => 'title', 'post_status' => 'publish', 'post_title' => 'title', 'post_type' => 'post', 'menu_order' => ''); //insert post $new_post_id = wp_insert_post( $new_post ); //NOW Update the new posts fields! required. //(it shoudl automatically create them if non-existent) update_post_meta($new_post_id, 'your-new-custom-field-slug', 1); } } } add_action('cred_before_save_data', 'record_status_change',10,1); 3. This checks the FORM's fields value against the CURRENT posts (same field) value. Relevant Documentation: |
2 | 14 | 8 years, 2 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, 2 months ago | ||
Layouts not working on Google Chrome
Started by: gavinS in: Toolset Professional Support |
2 | 4 | 8 years, 2 months ago | ||
Layouts not working properly
Started by: gavinS in: Toolset Professional Support |
2 | 7 | 8 years, 2 months ago | ||
Displaying posts where one of the fields is null
1
2
Started by: gavinS in: Toolset Professional Support |
2 | 21 | 8 years, 2 months ago | ||
Remove "No items found" from view
Started by: gavinS in: Toolset Professional Support |
2 | 3 | 8 years, 3 months ago |