• I’m trying to find out if there are any best practices for using shortcodes vs virtual pages in a plugin. Currently I’m developing a plugin that does both.

    It provides a handful of frontend virtual pages that “just work” for general users including the ability to select page templates for these virtual pages (theoretically). The virtual pages process shortcodes to display content thereby making shortcodes available to users to use in their pre-existing pages. Also, you can override the virtual pages by simply create a page in through the backend, using the same slug structure to override nested virtual pages, and create your own.

    Is this is a good or bad practice?
    Is there another way I should be thinking about this?

Viewing 1 replies (of 1 total)
  • Thread Starter Kaleb Heitzman

    (@kalebheitzman)

    I should also add that I’m doing this because of a frontend auth system I’m building into the plugin. I don’t want users generated on the backend of wordpress for what I’m developing, but each anonymous frontend post that gets stored on the backend in a custom post type has an email address associated with it.

    A user is going to be able to interact with what they’ve posted without a password by clicking on a link in their email address that contains a token that will have to match up with a custom table in the database. When they’re authenticated via the token (JWT implementation I think), then they’ll be able to leave notes on their submission. Creating all the pages to handle this could be confusing to the user and that’s why I want to setup virtual pages that already have the correct structure and content etc.

    Does this go against how WordPress would recommend handling things?

Viewing 1 replies (of 1 total)
  • The topic ‘Shortcodes vs Virtual Pages’ is closed to new replies.