Auto Slug Generation for Custom Post type
You can achieve this using the save_post hook. For example if you have a custom post type stack, the hook can be changed to save_post_stack. To set the post-slug to the first few words of the content: add_action( ‘save_post_stack’, ‘wpse251743_set_title’, 10, 3 ); function wpse251743_set_title ( $post_id ){ //This temporarily removes action to prevent infinite … Read more