gavinS
Fils de soutien créés au cours des 30 derniers jours : 0
Sujets de forum favoris
Cet utilisateur n'a aucun sujet favori.
Sujets de forum créés
Status | Sujet | Supporter | Voix | Publications | Nouveauté |
---|---|---|---|---|---|
Use repeating field values as options for a field on a CRED form
Commencé par : gavinS dans : Toolset Professional Support |
2 | 6 | Il y a 8 années | ||
Filter by custom date field to find posts from within the current month
1
2
3
Commencé par : gavinS dans : Toolset Professional Support |
3 | 35 | Il y a 8 années et 1 mois | ||
Conditional comparing current user meta to author meta
Commencé par : gavinS dans : Toolset Professional Support |
2 | 2 | Il y a 8 années et 1 mois | ||
Modify date upon save
Commencé par : gavinS
dans : Toolset Professional Support
Problem: Solution: Please check this answer: https://toolset.com/forums/topic/modify-date-upon-save/#post-374533 Relevant Documentation: |
2 | 8 | Il y a 8 années et 1 mois | ||
Same filter produces different results on different views
Commencé par : gavinS
dans : 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 | Il y a 8 années et 2 mois | ||
Trying to display parent post link, but child link is shown
Commencé par : gavinS
dans : 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 | Il y a 8 années et 2 mois | ||
Something strange happening with a count of posts
Commencé par : gavinS
dans : 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 | Il y a 8 années et 2 mois | ||
View stopped working after cloning
Commencé par : gavinS
dans : Toolset Professional Support
Problem: Solution: |
2 | 10 | Il y a 8 années et 2 mois | ||
Nested view with conditional sums
Commencé par : gavinS
dans : 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 | Il y a 8 années et 3 mois | ||
Record when changes are made to a certain field
Commencé par : gavinS
dans : 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 | Il y a 8 années et 3 mois | ||
Automatically change a field in one type when a field in another type is changed
Commencé par : gavinS
dans : 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 | Il y a 8 années et 3 mois | ||
Layouts not working on Google Chrome
Commencé par : gavinS dans : Toolset Professional Support |
2 | 4 | Il y a 8 années et 3 mois | ||
Layouts not working properly
Commencé par : gavinS dans : Toolset Professional Support |
2 | 7 | Il y a 8 années et 3 mois | ||
Displaying posts where one of the fields is null
1
2
Commencé par : gavinS dans : Toolset Professional Support |
2 | 21 | Il y a 8 années et 3 mois | ||
Remove "No items found" from view
Commencé par : gavinS dans : Toolset Professional Support |
2 | 3 | Il y a 8 années et 3 mois |