First off, it sounds like you might be able to solve your underlying question using BuddyPress.
If you simply want to make an actual WordPress page if a user registers you can do that using the user_register
hook. The hook receives the newly created user ID.
This code example should create a page with the user’s nicename
.
add_action( 'user_register', 'myplugin_add_page_for_user' );
function myplugin_add_page_for_user( $user_id ) {
// Get the user for this user_id
$user = get_user_by( 'id', $user_id );
// The data for the page we are going to add
$page_data = array(
'post_type' => 'page',
'post_title' => $user->user_nicename
);
// Actually insert the post
wp_insert_post( $page_data );
}
Related Posts:
- How to change the default registration email ? (plugin and/or non-plugin)
- Is it possible to access plugin data from a custom feed template?
- Automate configuration after new/hosted installation
- get_users by role returns all users
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Create Page that uses specific template
- Grid layout “last” class to every third item
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- How to display error on specific template?
- How to move style from template file to section?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- ACF image field to WordPress featured image
- bloginfo(‘template_directory’) img src
- Should template files be copied to the child theme for editing?
- ACF – Theming Flexible Content
- Calling an image within the theme folder from inside a post/page?
- Best Constant to use to check if WordPress is running
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- style sheet header on Page Templates
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- How to support custom templates on a custom post type?
- How to use $wpdb (from the template) to update the DB, without being an admin
- Page attributes missing
- Remove Items from Template Homepage
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- Is it possible to register a new template file?
- What template is used for viewing Media Library Files?
- != and !== both not always working? [closed]
- Remove portion of header code from home page only
- Use a separate template for the home page only
- Create a blank test.php
- How do I remove the word “Blog” from a WordPress Homepage?
- Prevent 404 and serve custom template for custom URL
- AMP version of front page without plugin
- Theme settings Page: Settings Api vs Update_Options
- How to add description over forum list on bbpress root page
- two active templates for one post
- Change “posts per page” depending on width
- Where is the code for “Front Page Template”?
- Help Understanding Template Hierarchy
- what is template-name.php
- What filter or action hook to use in order to load some code before the template begins printing in BuddyPress? [closed]
- templates with page teasers Or Featured Items
- If Child or Grandchild of Page
- Page template not registering on theme
- Is it possible to create custom links inside a template?
- How do I custom a page that doesn’t exist in the page list?
- How do I get tags linking to proper pages (/tag/sample-tag -> pages with that tag)
- Uncaught Error: Call to undefined function twentytwenty_the_post_meta()
- Timber + MtHaml, or any other HAML-like HTML shorthand
- How to name custom search page PHP file?
- small problem in the article ()
- Unable to access wordpress page
- How to configure my blog page
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Archive only for /year/month, not terms
- Why default template does not show?
- Why does the blog page not take the page template selected?
- Custom Taxonomy Theme file not routing correctly
- Why would adding a template file to a child theme cause an error in template-loader.php?
- How can I make is_page_template() workable in child theme?
- How can I add some blocks to template without changing template file?
- Creating a popup
- WordPress not picking up custom templates in sub directory
- Category template not displaying all post formats
- Is it possible to call a template file inside wysiwyg editor? And how?
- Retrieving post ID from current page
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- Taxonomy Parent not showing up in address bar
- Styling own template
- WordPress sites translate dynamically generated Homepages
- changes to templates not showing on server
- Why is this page using the homepage template and not the one it should?
- Single template will not show sidebar/bottom-nav and footer
- Problem with permalink structure for WordPress custom post_type archive template
- Strange Behavior of Page Template Dropdown
- WordPress Template works until page becomes a child
- Make default template two columns?
- Read more button not working
- pass dynamic value to page to pull in categorised post cards
- templates page not showing on gutenberg editor
- How to load php templates from html page (block theme)