[Resolved] Plugin that adds a page and protects it to only logged in users
I’m creating a plugin that adds a page using wp_insert_post. However, I need this page to only be accessible by logged in users. I tried to use !is_user_logged_in() but that doesn’t work. Seems like post_content only accepts HTML, and not PHP. Which makes sense. I guess I need to know how I can execute PHP code on that newly created page. Any way to attach additional code?
- The topic ‘[Resolved] Plugin that adds a page and protects it to only logged in users’ is closed to new replies.