i10n

Display a singular or pluralised string in WordPress

Sometimes, you may need to display a string differently depending on whether a variable is singular or plural. i.e; “1 product in stock” compared to “2 products in stock”. We could of course use an if() statement or even a switch() if there were multiple possibilities here, but for simple use cases, WordPress provides us […]

Phil Kurth Phil Kurth

Good dev stuff, delivered.

Product news, tips, and other cool things we make.

We never share your data. Read our Privacy Policy

© 2016 – 2024 Hookturn Digital. All rights reserved.