Problem:
The user would like to filter a view by date against two datetime custom fields.
Solution:
That's tricky, because dates are considered to have the time 00:00:00. So if an event begins and ends on the same day, the view will not find it.
The issue here is that our view only allows a maximum of 50 posts per page when using the pagination settings. However this user wanted to increase this to 70.
Solution:
This can be done by using the code below. Add the following to your Toolset custom code settings at Toolset->Settings->Custom Code. Once you've done this please ensure that you've activated it as well as change the ID 123 to the ID of your view.
The issue here is that our Toolset blocks plugin was throwing a fatal error on the user's site. Checking their debug data I saw that the user is running the site on PHP version 8
Solution:
Unfortunately we do not have a solution for this one as our Team has not yet announced compatibility for php version 8.
The workaround currently is to revert to a previous version of PHP 7
The customer asked how the WordPress user "Language" field can be set through the Toolset's user form.
Solution:
Informed that there is no built-in method available in the Toolset Forms for this, so it will require some workaround and custom code.
WordPress store's the ISO language code for the user's selected WordPress admin language as a value, in the user meta field with key 'locale'.
In a user registration form, one can include a hidden generic field and fill its value with the language code of the current page's language. After that, the 'cred_save_data' hook can be used to programmatically set that selected language value into the user's 'locale' meta field:
add_action('cred_save_data', 'my_save_data_action',10,2);
function my_save_data_action($user_id, $form_data)
{
// if a specific form
if ($form_data['id']==1234)
{
update_user_meta( $user_id, 'locale', $_POST['locale'] );
}
}