patronage / bubs-timber

Gulp + Timber + WP
Other
5 stars 1 forks source link

remove slugify, in favor of wordpress's default sanitize_title_with_d… #92

Closed yuvilio closed 6 years ago

yuvilio commented 6 years ago

Slugs (a lowercase dashed form of of a string) can come in handy within our templates periodically. They can be used to generate class or id names in the markup, for example.

We can generate a slug from the built in wordpress sanitize_title_with_dashes function..

Example usage: if my_field had 'Some Title' as the value:

{{ function('sanitize_title_with_dashes', my_field ) }} would render as 'some-title'.

So this PR removes the sluggify.php twig filter as superfluous. It seems intended for twig setups that did not have a built in slugification function like wordpress does.