7 years, 4 months ago
I’m trying to reduce the length of large numbers in the spans of some menu items. Such as…
Members 10,500 = Members 10.5K
Friends 2,000 = Friends 2k
I found this snippet:
Reduce Large Numbers to Human Readable Formats
However, is there a way to add it as a function without editing the template files?
You will need to use hooks. The basic idea is to attach a custom function to the relevant filter hook then inside your custom function you can use number_format() to group the thousands.
See also: WordPress.org •
Follow BuddyPress on Twitter •
Contact Us •
Terms of Service