I have a plugin that creates collaborative groups (bbpress). I want to automate creation of links to these groups by my users. The plugin converts the group names to a slug format for its URL - all lowercase letters and spaces replaced by -'s. E.g. hidden link. So either I have to convert what they enter as the name to this format e.g. Chief Academic Affairs Officers to chief-academic-affairs-officers, or I have to enforce use of lowercase and no spaces. Is there a way to do either of these in custom fields in Toolset?
Hello,
There is't such a built-in feature within Toolset plugins, you might consider custom codes, for example, setup two custom field s:
- Group name
- Group slug
After user fill the Group name, and save the post, use WordPress Action hook save_post to trigger a PHP function:
https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
In this PHP function, get the "Group name" field value:
https://developer.wordpress.org/reference/functions/get_post_meta/
get the slug format value:
https://codex.wordpress.org/Function_Reference/sanitize_title
save the slug value into Group slug into field "Group slug"
https://developer.wordpress.org/reference/functions/update_post_meta/
For your reference.
My issue is resolved now. Thank you!