Modifying post_type_link hook messing up edit function for a custom post

Modifying post_type_link hook messing up edit function for a custom post