Nashaat
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 |
---|---|---|---|---|---|
After manual Migration of the site with Modules some stuff not working properly
Started by: Nashaat in: Toolset Professional Support |
4 | 16 | 6 years, 1 month ago | ||
Wrong Time in Cred Field
Started by: Nashaat
in: Toolset Professional Support
Problem: Solution: add_shortcode( "now", function(){ // get UTC offset for current WP timezone $offset = get_option('gmt_offset'); return time() + $offset * 60 * 60; }); Relevant Documentation: |
2 | 5 | 6 years, 2 months ago | ||
Pre Selected/Checked Taxonomy when creating a new post from current Post
Started by: Nashaat
in: Toolset Professional Support
Problem: Solution: The client uses JS to automatically check one of the checkboxes. They wanted to get the value to be checked from the taxonomy assigned to the post where this form is displayed, i.e. using the wpv-post-taxonomy shortcode, but shortcodes are not expanded when adding code to the custom JS box. That can be solved by including the JS in script tags within the form editor, like so: <script> jQuery(document).ready(function() { jQuery("input[data-value='[wpv-post-taxonomy type="car-brand" format="name"]']").prop("checked", true); }); </script> Client goes on to implement a solution with pre-selected select dropdowns, which requires registering a custom shortcode as well, as described here: https://toolset.com/forums/topic/pre-selected-checked-taxonomy-when-creating-a-new-post-from-current-post/#post-1107705 |
2 | 11 | 6 years, 2 months ago | ||
Documentation is Missing!
Started by: Nashaat in: Toolset Professional Support |
2 | 6 | 6 years, 2 months ago | ||
Limit Size of uploaded image not working!
Started by: Nashaat
in: Toolset Professional Support
Problem: Validate file size of multiple instances image field. Solution: It needs to use filter hook cred_form_ajax_upload_validate, for example: https://toolset.com/forums/topic/limit-size-of-uploaded-image-not-working/#post-1088293 Relevant Documentation: |
2 | 5 | 6 years, 3 months ago | ||
Set WooCommerce Featured image from repeating custom image field
Started by: Nashaat
in: Toolset Professional Support
Problem: I would like to automatically set a post's featured image using the first image in a repeating custom image field. Solution: add_action('cred_save_data', 'save_img_0_as_featured',10,2); function save_img_0_as_featured($post_id, $form_data) { $forms = array( 123, 456 ); if ( in_array( $form_data['id'], $forms ) ) { $imgs = get_post_meta( $post_id, 'wpcf-rept-img'); if(isset($imgs) && isset($imgs[0])) { $img = $imgs[0]; $attachment_id = attachment_url_to_postid( $img ); update_post_meta( $post_id, '_thumbnail_id', $attachment_id ); } } } Change 123, 456 to be a comma-separated list of Form IDs where you want to apply this code. Then change rept-img to match your repeating image field slug. Relevant Documentation: |
2 | 3 | 6 years, 3 months ago | ||
Custom Code Snippet for Variable Product with Cred Form
Started by: Nashaat in: Toolset Professional Support |
2 | 3 | 6 years, 3 months ago | ||
Support Ticket System
Started by: Nashaat
in: Toolset Professional Support
Problem: Setup author field in Toolset post form. Solution: The user is using custom codes, see the details here: Relevant Documentation: |
2 | 9 | 6 years, 3 months ago | ||
Conditional Display by user Role stopped working after update.
Started by: Nashaat in: Toolset Professional Support |
2 | 9 | 6 years, 3 months ago | ||
Ordered Item Quantity in Views
Started by: Nashaat
in: Toolset Professional Support
Problem: I would like to use Views to display a list of WooCommerce Orders, the Products in each Order, and the prices and quantities of each Product. Solution: You can use Views to create a list of Orders and the Products in each Order, but prices and quantities of each Product will require custom code. Relevant Documentation: |
3 | 5 | 6 years, 3 months ago | ||
Edit Order link in orders list Loop
1
2
Started by: Nashaat in: Toolset Professional Support |
3 | 18 | 6 years, 3 months ago | ||
Are Toolset custom Field Supported in REST API?
Started by: Nashaat in: Toolset Professional Support |
3 | 5 | 6 years, 3 months ago | ||
Edit Users Role by Administrator or Editor
Started by: Nashaat
in: Toolset Professional Support
Problem: I would like to modify the roles associated with a new User when a Form is submitted. Solution: add_action('cred_save_data', 'my_save_data_action',10,2); function my_save_data_action($post_id, $form_data) { // if a specific form if ($form_data['id']==290) { $current_user_id = $post_id; $current_user_data = get_userdata( $post_id ); $oldroles = $current_user_data->roles; //here should be just one, as it is the first time you edit this user and it is only one-role if( !is_array($oldroles) ) { $oldroles = array($oldroles); } //Add new role after you remove old role $u = new WP_User( $post_id ); foreach( $oldroles as $oldrole ) { $u->remove_role( $oldrole ); } $newrole = $_REQUEST['user_select_role']; $u->add_role( $newrole ); } } Relevant Documentation: |
3 | 11 | 6 years, 4 months ago | ||
Change Product Status works but not as expected.
Started by: Nashaat in: Toolset Professional Support |
3 | 5 | 6 years, 4 months ago | ||
Cred Form CSS Editor Issue! extra slash sign after saving the form in CSS editor
Started by: Nashaat in: Toolset Professional Support |
2 | 3 | 6 years, 4 months ago |