On past few days, I was posted an article about creating WordPress Custom Login Page without Using a Plugin and on previous month I’ve posted another wordpress related article which is How to Create Custom Reset or Forget Password in WordPress and to complete wordpress Meta I decided to create a new article “WordPress Custom Registration without Using a Plugin”, this sounds really interesting right? To add registration in your site you can find various wordpress plugins directly in wordpress plugin directory but this tutorial might helpful to all web developer who are willing to learn in wordpress.
In this tutorial we’re using wp_insert_user() function to insert a user into the database, this functions can update a current user or insert a new user based on whether the user’s ID is present.
-->
Lets put in details the function we’re using in our code and its use.
I’ve added one hidden field to validate if the submitted form is for registration.
The detailed basic tutorial on how to create custom pate template can be found at WP Codex.
That’s it happy coding, if you have question, clarification just use the comment below or contact me directly.
In this tutorial we’re using wp_insert_user() function to insert a user into the database, this functions can update a current user or insert a new user based on whether the user’s ID is present.
Syntax
PHP code
This contains php script to validate and accept posted data from our HTML form.Lets put in details the function we’re using in our code and its use.
- email_exists: To look if the user email already exist.
- apply_filters: Calls filters for most of the $userdata fields with the prefix ‘pre_user’, where $userdata is the data contain to create user.
- do_action: Calls ‘user_register’ hook when creating a new user giving the user’s ID.
HTML code
Parameters
$userdata An array of user data.Complete Source Code
Below is the complete custom registration page source code, copy and paste the snippet below to test it yourself.That’s it happy coding, if you have question, clarification just use the comment below or contact me directly.
Sponsored Links
As this widget based on jQuery plugin, First you need to have a jQuery Plugin in your Blog template.
ReplyDeleteThis Step is Required, If your Blog already have this plugin then Ignore this Step.If your Blog Don’t have this Plugin, Install the jQuery Plugin.
wordpress chat plugin