AndreG3332
Admite hilos creados en los últimos 30 días: 0
Debates favoritos del foro
Este usuario no tiene debates favoritos.
Temas del foro creados
Status | Debate | Supporter | Voces | Mensajes | Caducidad |
---|---|---|---|---|---|
How Do i create a date filter for a View
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: The user wanted to create a parametric search for users. Solution: This way you can filter for their profiles rather than the actual user. Take a look at this link below. |
2 | 3 | hace 6 años | ||
Display the value of a field instead of the field itself
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 7 | hace 6 años | ||
to display filtered results in a view depending on the logged in user
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 2 | hace 6 años | ||
Field validation of post form
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: I would like to add custom validation to a Form that tests to see if any other post has the same custom field value. If so, an error should be displayed. Solution: Use the Forms validation API to query posts by meta key and value: add_filter( 'cred_form_validate', 'require_unique_doc_num_validation', 10, 2 ); function require_unique_doc_num_validation( $data, $form_data ) { $forms = array( 63, 456 ); // a comma-separated list of form IDs you want to validate $post_type_slug = 'document-master-list'; // your document cpt slug $field_slug = 'document-number'; // the field slug of the unique number from wp-admin $error_message = 'Unique document number is required'; // the error message you want to display // you should not edit anything below this line list($fields,$errors)=$data; if ( in_array( $form_data['id'], $forms ) ) { if ( !isset($fields['wpcf-' . $field_slug]['value'])) { $errors[$field_slug] = $error_message; } else { $doc_args = array( 'post_type' => $post_type_slug, 'numberposts' => -1, 'meta_query' => array( array( 'key' => 'wpcf-' . $field_slug, 'value' => $fields['wpcf-' . $field_slug]['value'] ) ), ); $matching_docs = get_posts( $doc_args ); if ( count($matching_docs) > 0 ) { $errors[$field_slug] = $error_message; } } } $data =array($fields,$errors); return $data; } Relevant Documentation: |
2 | 11 | hace 6 años | ||
Open child cred form from with in parent cred from
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: Solution: The expected workflow would be something like a form to publish the parent CPTs is inserted on one page, which displays the post after submission. The template for that post type includes a link to an edit form for the post, and also includes the form to add child posts (either directly, or linking to the form). |
2 | 3 | hace 6 años | ||
Setting up a relational post form
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: Setup relationship form using many-to-many relationship. Solution: Here are detail steps: https://toolset.com/forums/topic/setting-up-a-relational-post-form/#post-1154440 Relevant Documentation: |
2 | 7 | hace 6 años | ||
Display parent details as part of child post and open cred form when clicked
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: I would like to display information from two different grandparent post types on a parent post. I would also like to create a Form that creates child posts, and insert a link to that Form on the parent post so that the parent is automatically selected. Solution: Create a View of Requirement CPTs. In the Loop, you can insert the post title shortcode to display the related Company name. Click "Fields and Views", then "Post title", and you will be shown a popup. Click the "Post Selection" tab, then choose "A post related to the current post, set by a Types relationship". Next, select the Company post in your Company > Requirement post relationship. Create the new Submission Post Form and insert it in a custom Page. Then return to the View of Requirements editor and use the Toolset Forms button above the Loop Editor to insert a "Create Child Post Link". Select the Page containing the Submission Post Form, and a link will be automatically inserted for you. When Users click the link, they will be directed to the Page containing the new Submission Form. If you want to hide the parent select field in the Form, you can use CSS in the Form editor. <div style="display:none;"> [cred_field field="@relationship-slug.parent" class="form-control" output="bootstrap" select_text="--- not set ---"] </div> Relevant Documentation: |
2 | 4 | hace 6 años | ||
Bulk editing of details
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 3 | hace 6 años | ||
Set a child post title from parent post titles with code
Iniciado por: AndreG3332
en: Toolset Professional Support
Problem: I have a Form that creates posts and allows the User to choose two post parents from other post types. I would like to use the Forms API to automatically set the child post title to include the title of both parent posts. Solution: add_action('cred_save_data', 'your_save_data_action',10,2); function your_save_data_action($post_id, $form_data) { // if a specific form if ($form_data['id']==138) { $docyear = get_post_meta($post_id, 'wpcf-year', true); $custname = isset($_POST['@customer-requirement_parent']) ? get_the_title($_POST['@customer-requirement_parent']) : ''; $docname = isset($_POST['@document-master-list-requirement_parent']) ? get_the_title($_POST['@document-master-list-requirement_parent']) : ''; $drdetail= $docyear. ' - ' . $custname. ' - ' . $docname; $args = array('ID' => $post_id, 'post_title' => $drdetail); wp_update_post($args); } } Relevant Documentation: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data |
2 | 3 | hace 6 años | ||
Can you setup relationship fields with a user?
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 3 | hace 6 años, 1 mes | ||
Set post title with fields from CPT Not working
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 2 | hace 6 años, 1 mes | ||
Data validation on input forms
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 2 | hace 6 años, 1 mes | ||
How to setup a front end form with a parent and two child posts
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 4 | hace 6 años, 1 mes | ||
Auto population of table
Iniciado por: AndreG3332 en: Toolset Professional Support |
2 | 8 | hace 6 años, 1 mes | ||
linking parent and child forms
1
2
Iniciado por: AndreG3332 en: Toolset Professional Support |
3 | 24 | hace 6 años, 10 meses |