I’m trying to add a css id to an element that is the same as the value it is given, but stripped from all spaces and special characters.
So for example if I have a field with a value of “*Title& example” I want it to output something like this: <h3 id=”1-title-example”>Title example</h3>
Normally this would be simply done by something like this: <h3 id" <?php the_field('title'); ?> "><?php the_field>('title'); ?></h3>
But of course that doesn’t work with outputting clean values (without spaces, etc.).