I have a pretty good question here. I would like to create a hidden page on my wordpress blog for each user as they are registered. I already have most of the code of what needs to be put on the page with a simple shortcode. All I need is something to actually make the page. Here is some of my code.

function added($user_id)
global $wpdb;

// Create a page for the user with certain settings
add_action( 'user_register', 'added' );

function author_page($atts, $content = null)
    // Some code here on what to output on the page...
add_shortcode( 'author', 'author_page');

Well, that's pretty much what I've got with about 350 lines of code in the author_page function and some other stuff that the plugin will do. All I need to do, is in the // WHAT DO I PUT HERE!? bit, I need some code that will allow me to create a page, under the subheading authors, make it not seen on the dropdown of that menu page, and then put the shortcode [author id="1 or whatever it is"]Some description of the Author, or could be left out...[/author] on the page.

  • Create a custom post type named userinfo.
  • On 'user_register' call wp_insert_post() in your filter, and create a new post for the user. Add the user ID as post meta field.
  • When the new page is called on the front-end, display the user data.
|improve this answer|||||
  • Thank you so much. I actually found this but had to leave and couldn't post my findings. Thanks! – Ethan Brouwer Oct 30 '12 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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