Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am developing a Wordpress plugin handling a calender in which it is possible to sign up for a given event. As part of this, I want to make a custom page for the signup-form and confirmation message to the client, however I have no idea how to do this.

I have seen that there is a wp_insert_post() function to insert a new post, but I need a page with custom plgin content (signup form) instead.

Is this even possible to do and how do I do this if it is?

Thanks

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

You can use wp_insert_post for creating the page.

<?php
    $content = '<Sign up form content>';
    wp_insert_post(array(
        'post_title' => 'My page',
        'post_content' => $content,
        'post_type' => 'page', //VERY IMPORTANT
        'post_status' => 'publish/draft'
    ));

Check it.

share|improve this answer
    
Just one more question: how do I then access this page using a link? –  Simon Aug 23 '12 at 8:02
1  
Check the Pages section for your custom page and check it's permalink. –  Rutwick Gangurde Aug 23 '12 at 8:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.