Home › Forums › General Issues › Fields not saving – Slug › Reply To: Fields not saving – Slug
You’re going to need to add some more information that I don’t see in any of your code, but I found a function in WP that will do this https://codex.wordpress.org/Function_Reference/wp_unique_post_slug
$data['post_name'] = wp_unique_post_slug(sanitize_title( $data['post_title'] ), $post_id, $post_status, $post_type, $post_parent);
It appears that all of the arguments for this function are required and there’s not much information on using it.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.