_wp_to_kebab_case
_wp_to_kebab_case ( $input_string )
Parameters:- (string) input_string The string to kebab-case.
Links:Returns:- (string) kebab-cased-string.
Defined at: - Introduced in WordPress: —
- Deprecated in WordPress: —
Description
This function is trying to replicate what
lodash's kebabCase (JS library) does in the client.The reason we need this function is that we do some processing
in both the client and the server (e.g.: we generate
preset classes from preset slugs) that needs to
create the same output.
We can't remove or update the client's library due to backward compatibility
(some of the output of lodash's kebabCase is saved in the post content).
We have to make the server behave like the client.
Changes to this function should follow updates in the client
with the same logic.