Allow User to Edit Page Based on their Email

I think the simplest way to do this would be to give the users a customized Author role when they register. The capabilities of the default Author role are that they can only create and edit their own posts. You’ll have to customize this to enable capabilities for your ‘class’ custom post type, not just vanilla posts. You can hook the user_register action to query for a faculty post with meta value matching the registered user’s email, then update the user to give them your special role if a matching faculty post is found. For the class posts, hook save_post to add a connection between that post and the user’s faculty page whenever they create a new class post.

Leave a Comment