jeffS-2
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 |
---|---|---|---|---|---|
Trouble using single and double quotes in wpv-conditional
Started by: jeffS-2
in: Toolset Professional Support
Problem: I am trying to use wpv-conditional to test for an empty value in an email custom field. If I include another shortcode inside the wpv-conditional, it does not work as expected. Solution: Add the following line to your wp-config.php file to disable the PCRE regex engine: ini_set('pcre.jit', false); |
2 | 6 | 5 years, 11 months ago | ||
How to get field value in CPT using PHP?
Started by: jeffS-2
in: Toolset Professional Support
Problem: In a single "member's profile" post, there is a custom date field "expire-date", which is created with Types plugin, you are going to get the "Year" value from "expire-date" field. Solution: You can try get the timestamp value of "expire-date" field with function get_post_meta(), for example: $expire_date_timestamp = get_post_meta(get_the_ID(), 'wpcf-expire-date', true); Then you can get the year value by timestamp using PHP function date, like this: $expire_date_year = date('Y', $expire_date_timestamp); Relevant Documentation: http://php.net/manual/en/function.date.php https://developer.wordpress.org/reference/functions/get_post_meta/ |
2 | 4 | 5 years, 11 months ago | ||
Better to use “eq” or “==” ? And better to use “empty()” or “eq (empty str)” ?
Started by: jeffS-2
in: Toolset Professional Support
Problem: Using [wpv-conditional] shortcode, I am curious if it is better (or matters) to use eq/neq or use ==/!= ? Also, is there a difference between using empty($wpcf-field-name) or using $wpcf-field-name eq "" ? Solution: I suggest you use eq/ne in your [wpv-conditional] shortcodes. Using empty($wpcf-field-name) or using $wpcf-field-name eq "" are same result, you can use one of them. Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional |
2 | 4 | 5 years, 11 months ago | ||
How to update Types default value for custom field programatically?
Started by: jeffS-2
in: Toolset Professional Support
Problem: I have a CPT called Member_Profile with a field called "expiration-date" which defaults to the following year when a new member signs up, since membership is good for one year. All memberships expire on 31-Dec-yyyy. This field hold only yyyy. I have to update this field manually in the Types Post Field Group every December. I am trying to write a PHP function or filter to do this automatically but not sure how to do it. Solution: Yes, it needs custom codes, for example, you can try the filter hook "wpt_field_options", like this: Relevant Documentation: |
2 | 5 | 5 years, 11 months ago | ||
How to update a specific field, such as expiration-date, for multiple members?
Started by: jeffS-2 in: Toolset Professional Support |
2 | 5 | 5 years, 11 months ago | ||
Switching to PHP 703 causes wpv-if to not be recognized?
Started by: jeffS-2
in: Toolset Professional Support
Problem: Test a local instance of a site for PHP 7 compatibility, but there are a bunch of [wpv-if] shortcodes displayed. Solution: You can replace all [wpv-if] shortcodes with [wpv-conditional] shortcodes, and test again. Relevant Documentation: https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-conditional |
2 | 3 | 5 years, 11 months ago | ||
Which hook to use to create new user from CRED form?
Started by: jeffS-2 in: Toolset Professional Support |
2 | 3 | 6 years, 1 month ago | ||
Are required fields in CRED now pink background upon loading a fresh form?
Started by: jeffS-2 in: Toolset Professional Support |
2 | 4 | 6 years, 5 months ago | ||
CRED required fields are now pink background?
Started by: jeffS-2 in: Toolset Professional Support |
2 | 6 | 6 years, 5 months ago | ||
Uploading image file in CRED Editing Form requires Admin privilege
Started by: jeffS-2
in: Toolset Professional Support
Problem: Solution: Please open a new ticket if you see this issue on your own site. Relevant Documentation: |
2 | 7 | 6 years, 5 months ago | ||
Possible to get userAgent info and send with email notification from CRED form?
Started by: jeffS-2
in: Toolset Professional Support
Problem: I would like to capture the userAgent information from the browser in a CRED form, and access that information in an email notification. Solution: In order to send the User Agent information to the admin in a notification email, it must be inserted as the value of a generic field. If you do not place this information in an input field of some kind, the email notification system will not be able to access it. If you do not want to show the User Agent information to the end User filling out the form, use a "hidden" type generic field. The value will still be captured, but it won't be shown on the front-end. This generic field code should be added to the form: [cred_generic_field field='useragent' type='hidden' class='' urlparam=''] { "required":0, "validate_format":0, "default":"Form custom JavaScript error" } [/cred_generic_field] Add this JavaScript in the CRED form's JS panel to insert the User Agent value in the generic field: jQuery(window).bind('load', function(){ jQuery('input[name="useragent"]').val(navigator.userAgent); }); This code should be added to functions.php to allow you to access the generic field value in email notifications: add_filter('cred_body_notification_codes', 'custom_generic_field_notification'); add_filter('cred_subject_notification_codes', 'custom_generic_field_notification'); function custom_generic_field_notification( $defaultPlaceHolders ) { $newPlaceHolders = array( '%%USER_AGENT%%' => $_REQUEST['useragent'] ); return array_merge($defaultPlaceHolders, $newPlaceHolders ); } Then in your email notification, you can access the User Agent information like so: User Agent: %%USER_AGENT%% Relevant Documentation: |
2 | 8 | 6 years, 7 months ago | ||
How to modify the validation messages for fields used in a CRED form?
Started by: jeffS-2
in: Toolset Professional Support
Problem: Solution: For Types fields the validation messages are set on custom fields themselves. |
2 | 3 | 6 years, 7 months ago | ||
Creating Complex Views Filter with ANDs and ORs ?
Started by: jeffS-2
in: Toolset Professional Support
Problem: I want to display video recording links from an Event. Some events have a pre-event meeting that also has a video recording. I have more than one type of event so, I only want to display the video links that are of event Type 1 AND the video recording link field is not empty - OR the pre-event video recording link field is not empty. Logic should be something similar to this: if ( (event-type === '1') AND ( (video-link-1 > 0) OR (video-link-2 > 0) ) ) Solution: I suggest you try this: 1) Edit your view, setup the filters as: (video-link-1 > 0) OR (video-link-2 > 0) 2) In the Views loop, use shortcode [wpv-conditional] to check the custom field "event-type" value, if the value is "1", then display this item. Relevant Documentation: https://toolset.com/documentation/user-guides/conditional-html-output-in-views/ |
2 | 4 | 6 years, 8 months ago | ||
CRED: Support for new Invisible ReCAPTCHA?
Started by: jeffS-2
in: Toolset Professional Support
Problem: Solution: |
2 | 5 | 7 years ago | ||
Trying to set a last-modified date field for CPT post using PHP
Started by: jeffS-2
in: Toolset Professional Support
Problem: Solution: You can find proposed solution with the following reply: Relevant Documentation: |
2 | 5 | 7 years ago |