Problem:
The customer wants to modify the labels of the login form so that users can log in with their email only, not their username. They can add the login form via shortcode but need to customize the form labels. Solution:
We informed the customer that customizing the login form labels requires adding custom code to the theme/child theme's function.php file. We initially provided the following code snippet:
add_filter('gettext', 'user_label_change', 20, 3);
function user_label_change($translated_text, $text, $domain) {
if ($text === 'Username or Email' && $domain == 'default') {
$translated_text = 'Email';
}
return $translated_text;
}
The customer later managed to achieve their goal with a different function:
add_filter('gettext', 'register_text');
function register_text($translating) {
$translated = str_ireplace('Username or Email', 'Your Custom Text', $translating);
return $translated;
}
Problem:
The customer wants to display more than 50 items on a single page. They are not following any documentation and do not have an example to reference. Solution:
We informed the customer that currently, it is only possible to change the maximum items from 50 to a higher number using custom code. We provided the following code snippet to be added to their child theme's/theme's function.php file:
I want to use a Toolset Form to edit the Menu Order value of posts, but I can't see a way to do this through the standard Toolset Form functionalities.
Solution:
Add a generic input to the form with the slug name the-order. Then, add custom code to the Toolset custom code section to update the Menu Order using cred_save_data action.
Sample code to get started:
add_action('cred_save_data', 'update_post_order', 10, 2);
function update_post_order($post_id, $form_data) {
// Check if the correct form is being submitted
if ($form_data['id'] == [YOUR_FORM_ID]) { // Replace [YOUR_FORM_ID] with the actual ID of your form
if (isset($_POST['the-order'])) {
$new_order = intval($_POST['the-order']); // Ensure the input is treated as an integer
// Update the post order
$args = array(
'ID' => $post_id,
'menu_order' => $new_order
);
wp_update_post($args);
}
}
}
Toolset map shows the markers for the items that are currently showing on the search page.
If you use pagination and there are some entries that goes to the second page, will not show on the map and you need to click the pagination controls to load them to show on the map.