This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: How to Max Length CustomField result to 100

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to Max Length CustomField result to 100 Reply To: How to Max Length CustomField result to 100

#30436
Ernest MarcinkoErnest Marcinko
Keymaster

Actually, I may have found a much better solution. Instead of the previous code, you can use the one below. With that, you can use the advanced description field as before, it will automatically change the maximum length of all field values to 100:

add_filter('asp_cpt_advanced_field_value', 'change_asp_cpt_advanced_field_value', 10, 2);
function change_asp_cpt_advanced_field_value($value, $field_name) {
    $length = 100;
    return wd_substr_at_word($value, $length);
}