• Resolved samiam567

    (@samiam567)


    Hi, I’m trying to create a plugin that will create classes for my website, class-advisor.com

    Basically, all I need is a function that I can use to create pages on the frontend of the website. I know that bbpress does this by creating the members, groups, login page, etc.

    Any Help would be appreciated.
    Note: I am a relative beginner to WordPress plugin development

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Do you mean a page similar to the page edit screen, except it’s on the front end?

    Make a custom page template that includes HTML form fields. When the form submits the field data, it can go to the same page as the form. Your code can use a conditional structure like if a certain field in $_POST is set to process the data instead of displaying the form.

    Assemble the data into an array compatible with wp_insert_post(). This works for pages too, specify ‘page’ as the post_type.

    Create a WP page based on this template. Use the page’s permalink to access the form.

    Thread Starter samiam567

    (@samiam567)

    Thanks! I’ll try that.

    Thread Starter samiam567

    (@samiam567)

    Just finished programming the first usable version. REALLY buggy, but it’s a proof of concept.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Create a page with a plugin’ is closed to new replies.