• Hi,

    i just resently started writing my first plugin for wp. a small event-manager for my clubs website (none of those event-manager plugins ready to use is matching our needs).

    so i coded some admin pages for my plugin. connect it to the wp database. so far thats all good to me. but i still don’t know how i realize my frontend of the plugin.

    plugin frontend needs:
    – user has to fill up some data in my special forms
    – data needs to be send by form to the next page

    question:
    – how can i send those data via method post/get to the next page to go on?
    – add_shotcode seems good for small plugin-snippets, but my plugin will include a qouple of functionality. is there a alternative to add_shortcode?

    hope you understand my issue. 🙂

    thanks!
    janek

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    You have limited choices when submitting data to a code page that needs to access WP resources. Probably the easiest is to put your code on a custom page template. The template does not need to be in the theme folder if you don’t care that it does not appear in the page editor template dropdown.

    You can create a page by script when the plugin is activated. Just insert the page as usual using the default template. Then change the page’s post meta under the ‘_wp_page_template’ key to the actual template path. The only purpose of inserting a page is to have a slug with which you can address the page.

    Instead of having multiple templates for each page, you can put everything on a single template that outputs varying content depending on what data was last submitted.

    FYI, the only other choices are to use AJAX techniques through admin-ajax.php or use a similar technique through admin-post.php, which does not require javascript like AJAX does.

Viewing 1 replies (of 1 total)

The topic ‘Frontend of my Plugin’ is closed to new replies.