WordPress.org

Support

Support » Plugins and Hacks » Hacks » [Resolved] Plugin that adds a page and protects it to only logged in users

[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?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Plugin that adds a page and protects it to only logged in users’ is closed to new replies.
Skip to toolbar