AndreG3332
Fils de soutien créés au cours des 30 derniers jours : 0
Sujets de forum favoris
This user has no favorite topics.
Sujets de forum créés
Status | Sujet | Supporter | Voix | Publications | Nouveauté |
---|---|---|---|---|---|
How Do i create a date filter for a View
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Display the value of a field instead of the field itself
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 7 | Il y a 6 années | ||
to display filtered results in a view depending on the logged in user
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 2 | Il y a 6 années | ||
Field validation of post form
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Open child cred form from with in parent cred from
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Setting up a relational post form
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Display parent details as part of child post and open cred form when clicked
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Bulk editing of details
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 3 | Il y a 6 années | ||
Set a child post title from parent post titles with code
Commencé par : AndreG3332
in: 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 | Il y a 6 années | ||
Can you setup relationship fields with a user?
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 3 | Il y a 6 années et 1 mois | ||
Set post title with fields from CPT Not working
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 2 | Il y a 6 années et 1 mois | ||
Data validation on input forms
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 2 | Il y a 6 années et 1 mois | ||
How to setup a front end form with a parent and two child posts
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 4 | Il y a 6 années et 1 mois | ||
Auto population of table
Commencé par : AndreG3332 in: Toolset Professional Support |
2 | 8 | Il y a 6 années et 1 mois | ||
linking parent and child forms
1
2
Commencé par : AndreG3332 in: Toolset Professional Support |
3 | 24 | Il y a 6 années et 10 mois |