Tim Elliott
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 |
---|---|---|---|---|---|
Views Conditional wpv-post-author problem
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: I have a conditional that tests the current User against the author of a post. The conditional works in the context of a post, but I would like to use the same conditional in another page where the post ID is set by a URL parameter. Solution: You could use a custom shortcode like this instead: [wpv-conditional if="('[wpv-current-user info='user_login']' eq '[author_login_from_post_id_param]')"] Content 2 [/wpv-conditional] Add this code to your child theme's functions.php file: function author_login_from_post_id_param_func($atts) { $postid = isset($_GET['postid']) ? $_GET['postid'] : 0; $thepost = $postid ? get_post($postid) : 0; $author = $thepost ? $thepost->post_author : 0; $login = $author ? get_the_author_meta('user_login', $author) : ''; return $login; } add_shortcode("author_login_from_post_id_param", "author_login_from_post_id_param_func"); Then go to Toolset > Settings > Frontend Content and register author_login_from_post_id_param in the third-party shortcodes section. |
2 | 3 | hace 6 años, 5 meses | ||
Cred maximum upload size for file type field
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: I would like to validate the file size of files uploaded to a custom field in CRED. Solution: Use the cred_form_ajax_upload_validate hook to test upload file sizes. Use conditionals to check each file individually. // For the resource file upload - check that the file is a PDF under 1MB in size. add_filter('cred_form_ajax_upload_validate','cred_filetype_size_validation',10,2); function cred_filetype_size_validation($error_fields, $form_data) { //field data are field values and errors list($fields,$errors)=$error_fields; //validate if specific form if ( ($form_data['id']==889) || ($form_data['id']==846) ) { if(isset($fields['wpcf-resource-file'])) { //Retrieve file type $file_type_uploaded=$fields['wpcf-resource-file']['field_data']['type']; //Retrieve file size $file_size_uploaded=$fields['wpcf-resource-file']['field_data']['size']; //check if featured image exists if ( ($file_size_uploaded > 1000000) || ($file_type_uploaded != 'application/pdf') ) { //set error message for featured image $errors['Resource File'] = 'Sorry the file you have uploaded is not of correct type (PDF) or exceeded 1MB limit'; } } } //return result return array($fields,$errors); } Relevant Documentation: |
2 | 5 | hace 6 años, 6 meses | ||
CRED create new child post with parent set automatically.
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: For example: [cred_generic_field field='_wpcf_belongs_home_id' type='hidden' class='' urlparam=''] { "required":0, "validate_format":0, "persist":1, "default":"[wpv-post-id]" } [/cred_generic_field] You can find proposed solution, in this case, with the following reply: Relevant Documentation: |
2 | 5 | hace 6 años, 6 meses | ||
Follow up to «Membership to allow access to front-end editing of specific posts»
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: I am using Toolset form and CRED commerce plugins, if the customer fails to complete checkout, instead of changing the post status to "Pending" or "Draft" it just changes the free-premium field to free? Solution: I suggest you try this: 1) In your CRED form, but don't display "free-premium" field, so when user submit the CRED form, it won't change the value of "free-premium" field. 2) After the users submit the CRED form and complete the Woocommerce order, use the CRED commerce action hook "cred_commerce_after_order_completed" to trigger a custom PHP function, in this function, update the "free-premium" field to what you want. See the codes provided by client: Relevant Documentation: Action to be executed after WooCommerce order status is set to completed. |
2 | 4 | hace 6 años, 6 meses | ||
Membership to allow access to front-end editing of specific posts.
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 3 | hace 6 años, 6 meses | ||
View content overlays my spinner overlay
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 4 | hace 6 años, 7 meses | ||
Designating a post as featured within a category
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 6 | hace 6 años, 7 meses | ||
Custom Taxonomy functionality not working
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: The issue here is that the user is unable to edit his custom taxonomy created in Types. Solution: Normally issues like these are caused by either a plugin/theme conflict or the server is using an outdated version of PHP. First I would recommend that you temporarily disable all the non-toolset plugins and try again. If that doesn't work please ensure that your server is running at least php 7 |
2 | 8 | hace 6 años, 8 meses | ||
[Potential bug report] post relationships
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 15 | hace 6 años, 9 meses | ||
[wpv-add-to-cart-message] doesn't always display messages immediately
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 6 | hace 6 años, 9 meses | ||
User meta is not displaying any output
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 7 | hace 6 años, 9 meses | ||
Converting a timestamp to date and time
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: Solution: // Add Shortcode function convert_date( $atts ) { // Attributes $atts = shortcode_atts( array( 'timestamp' => '', ), $atts ); $date = Date('F j, Y, g:i a',$atts['timestamp']); return $date; } add_shortcode( 'convert_date', 'convert_date' ); Then pass the other shortcode into it link this [convert_date timestamp="[wpv-post-field name='we_startdate']"] |
3 | 4 | hace 6 años, 11 meses | ||
Error when updating Views to v2.5
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 9 | hace 7 años, 1 mes | ||
Condiional Display for repeatable group applied to whole group.
Iniciado por: Tim Elliott en: Toolset Professional Support |
2 | 14 | hace 7 años, 1 mes | ||
Getting multiple Warning: Illegal string offset after adding a repeating field
Iniciado por: Tim Elliott
en: Toolset Professional Support
Problem: Warning: Illegal string offset 'id' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/classes/wpviews.php on line 137 Warning: Illegal string offset 'name' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/classes/wpviews.php on line 138 Warning: Illegal string offset 'slug' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields.php on line 719 Warning: Illegal string offset 'type' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields.php on line 722 Warning: Illegal string offset 'slug' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/fields.php on line 723 Warning: Illegal string offset 'id' in /home/xxx/public_html/wp-content/plugins/types/vendor/toolset/types/embedded/classes/wpviews.php on line 140 Solution: |
2 | 3 | hace 7 años, 1 mes |