I have a custom field that I would like to use as the post's slug. I'm able to get the custom field to be used as the slug for the post but I'm having problems attaching a /prefix/ before the postname.
This is the code I have so far (If you want to use something else, substitute /episode/ with your choice)
wp_update_post(array('ID' => $post->ID,'post_name' => 'episode/'. get_post_meta($post->ID,'incr_number', true)));
When it's save, the post's slug is domain/episode1 and I'm trying to get /episode/1.