I'm trying to use the slug as a way to filter through posts on Toolset. I understand that there is no support for a filter query based on the page's slug but I figured it could work if I automatically update a custom field with the value of the post's slug using the update_post_meta function. This is just a little beyond my skills.
I have a post type called Meetings (slug: meeting) which autogenerates a unique slug on creation. So far, I've created the new custom field in Toolset called Meeting Token (slug: meeting-token). I'm not sure how I could either adjust the function I've included below to do it all at once or create a second function to update the custom field.
function func_update_unique_custom_slug( $data, $postarr ) {
if($data['post_status']=='auto-draft' and $data['post_type']=='meeting')
$data['post_name'] = uniqid();
Do you mean that the automatic slug created using the function uniqid() or you can say this uniquid() is assigned to post_name (post slug) you want to copy the same post slug to your custom field (meeting-token) and copy the uniqid() value to custom field (meeting-token) value?