Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue/1965 add ability to only show first letter of name fields #2140

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

omarkasem
Copy link
Collaborator

@omarkasem omarkasem commented Sep 14, 2024

@omarkasem omarkasem linked an issue Sep 14, 2024 that may be closed by this pull request
6 tasks
@omarkasem omarkasem self-assigned this Sep 14, 2024
@mrcasual
Copy link
Collaborator

@Mwalek, please test. Try using Arabic, Cyrillic and other scripts. Test the gk/gravityview/fields/name/initials filter as well.

@Mwalek
Copy link

Mwalek commented Sep 18, 2024

@mrcasual Overall, everything worked as expected. For Asian languages like Chinese, the entire first character was shown rather than a single initial, which is likely expected behavior due to how these scripts represent names.

The behavior was a bit weird when using emojis and parentheses, but not sure we want to support such edge cases (see image).

Screenshot 2024-09-18 at 3 39 20 PM

Some of my tests can be observed at the following URL:
https://basecamp.try.gravitykit.com/display-pull-2140-view/

Filter Testing

I also tested the filter gk/gravityview/fields/name/initials using the following code:

add_filter('gk/gravityview/fields/name/initials', 'customize_initials', 10, 2);

function customize_initials($display_value, $gravityview) {
    
    $display_value = strtolower($display_value);

    return $display_value;
}

All good! The filter successfully altered the display of initials (English ones), converting them to lowercase as expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to only show first letter of name fields
3 participants