Convert Field String into Slug

Use to convert text with spaces into lowercase data with dashes so it can be used for element tags.

<?php $page_link = sanitize_title_for_query( get_field('title') ); ?>

<div id="<?php echo esc_attr( $page_link ); ?>">

<!-- content -->



Leave a Reply

Posted in php
katherine as a flat graphic icon

About Me

I’m an African / Ojibwe First Nations Web Developer living in Winnipeg, Manitoba.

Visit the Tips and Blog to see what I’m working on.