• Hello,
    I have to create a plugin using endpoints (or rewrite rules) to make virtual pages (not manually created in the backend) having custom content coming from the plugin functions.

    I looked at ‘template_include’ filter, but this template replaces all theme html (header, main content, footer…) and I’m looking to make the plugin not dependant from theme.

    I’ve looked also at shortcodes, but these are inserted in pages made in the backend.

    What is the correct approach to do this?

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    The correct approach is what is easiest and most intuitive for your users. From the options you’ve discounted I think you should consider creating custom pages based on your own template code when your plugin is activated. Be sure to take measures to avoid name collisions.

    Then when your plugin is deleted (not just deactivated) offer the option to remove these posts and otherwise cleanup anything your plugin has left in the DB.

    Is this the correct approach? I don’t know. I’ve used it a number of times without any problems, my clients are happy.

Viewing 1 replies (of 1 total)
  • The topic ‘Endpoint with custom content/template’ is closed to new replies.