andrewB-7
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 |
---|---|---|---|---|---|
Upload of the .jfif file type in CRED forms
Started by: andrewB-7 in: Toolset Professional Support |
2 | 5 | 6 years, 6 months ago | ||
Limit number of characters/words output by multiline text field in PHP archive
Started by: andrewB-7
in: Toolset Professional Support
Problem: The issue here is that the user wanted to limit the word that is being displayed from a custom field in php. Solution: The user is currently using this to display his custom field using PHP <?php if(types_render_field("author-member-new-bio", array('class'=>''))){?> <?php echo(types_render_field("author-member-new-bio", array('class'=>''))); ?> <?php }?> This can be done by using the wp_trim_words function as you can see from this it can be used to trim the words. <p class="paragraph-about"><?php echo wp_trim_words( get_field('author_member_new_bio'), 60, '...' ); ?></p> |
2 | 4 | 6 years, 6 months ago | ||
URGENT Latest version of Types causing site to break
1
2
Started by: andrewB-7 in: Toolset Professional Support |
3 | 17 | 6 years, 6 months ago | ||
Make CRED fields required, but do not require the fields in wp-admin
Started by: andrewB-7
in: Toolset Professional Support
Problem: I would like to make some custom fields required in a CRED Form, but I would like to make the same fields optional when editing in wp-admin. Solution: add_filter( 'cred_form_validate', 'custom_story_validation', 10, 2 ); function custom_story_validation( $data, $form_data ) { $forms = array( 123, 456 ); if( in_array( $form_data['id'], $forms ) ){ list($fields,$errors)=$data; if (empty($fields['wpcf-email'])) { $errors['email'] = __('Email address is required', 'your-language-domain'); } if (empty($fields['wpcf-telephone'])) { $errors['telephone'] = __('Telephone is required', 'your-language-domain'); } if (empty($fields['wpcf-location'])) { $errors['location'] = __('Location is required', 'your-language-domain'); } $data =array($fields,$errors); } return $data; } Relevant Documentation: |
2 | 9 | 6 years, 7 months ago | ||
Create post with automatic taxonomy term using CRED
Started by: andrewB-7
in: Toolset Professional Support
Problem: I have 3 CRED forms that create new posts in the same post type. I would like to automatically assign one term to each new post, and I would like that term to be different for each form. I tried using the "value" attribute of the cred_field shortcode, but it does not appear to save the correct term information. Solution: The "value" attribute of a cred_field with single_select does not apply to taxonomy term fields. Instead, you can do something similar with the CRED API: add_action('cred_save_data', 'auto_cred_term_action',10,2); function auto_cred_term_action($post_id, $form_data) { // form #1 if ($form_data['id']==123) { $tag = array( 11 ); // Taxonomy term ID $taxonomy="storytypes"; // Taxonomy name wp_set_post_terms( $post_id, $tag, $taxonomy ); } // form #2 if ($form_data['id']==234) { $tag = array( 22 ); // Taxonomy term ID $taxonomy="storytypes"; // Taxonomy name wp_set_post_terms( $post_id, $tag, $taxonomy ); } // form #3 if ($form_data['id']==456) { $tag = array( 33 ); // Taxonomy term ID $taxonomy="storytypes"; // Taxonomy name wp_set_post_terms( $post_id, $tag, $taxonomy ); } } Remove the taxonomy cred_field shortcode from the form, and modify the form and term IDs as needed in the code above. Relevant Documentation: |
2 | 11 | 6 years, 8 months ago | ||
Conversion of fields
Started by: andrewB-7
in: Toolset Professional Support
Problem: Solution: You need to delete the WYSIWYG field and make a new multiline field. |
2 | 3 | 6 years, 8 months ago | ||
Display of field on front end without WYSIWYG options
Started by: andrewB-7
in: Toolset Professional Support
Problem: Solution: You can find proposed solution, in this case, with the following reply: Relevant Documentation: |
2 | 6 | 6 years, 8 months ago | ||
Repeating field groups in CRED forms
Started by: andrewB-7
in: Toolset Professional Support
Problem: Solution: |
2 | 8 | 6 years, 8 months ago | ||
Remove Bootstrap toolbars from all Visual Editors
Started by: andrewB-7
in: Toolset Professional Support
Problem: I would like to disable the Bootstrap toolbars from all Visual Editors on my site. Solution: Add the following code to functions.php: add_filter( 'mce_buttons_3', 'remove_bootstrap_buttons', 999 ); function remove_bootstrap_buttons($buttons) { return array(); } add_filter( 'mce_buttons', 'remove_bootstrap_toggle_button', 999 ); function remove_bootstrap_toggle_button($buttons) { $remove = array( 'css_components_toolbar_toggle' ); return array_diff( $buttons, $remove ); } |
2 | 4 | 6 years, 10 months ago | ||
Unable to assign fields to post type
Started by: andrewB-7 in: Toolset Professional Support |
2 | 5 | 7 years ago | ||
Order posts by custom date field
Started by: andrewB-7 in: Toolset Professional Support |
2 | 2 | 7 years ago | ||
Displaying date field information in PHP template file
Started by: andrewB-7
in: Toolset Professional Support
Problem: These need to be outputted separately in different places in the template. This is to allow me to display dates as in the attached screenshot. The field (if that helps) is called 'start-date-for-course' Solution: echo types_render_field( 'start-date-for-course', array( 'format'=>"M d") Relevant Documentation: |
2 | 3 | 7 years ago |