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 studying "action and filter" and confused.

I have a theme and I need to add "phone number1, phone number2" on register form page. I have been trying to file apply filter or add action on the register form page, but I can't really find them.

Then do I need to modify the php file as child theme?
I mean do I need to create a register form page and add apply filter or add action? if I want to add some more input fields, do I need to add each of filters or actions?

Let's say the original form is like this.

input type='text' name='usersname'
input type='text' name='email'
input type='password' name='password1'
input type='password' name='password2'

Now, I need to add 3 more fileds which are "address" between username and email and "phone number1, phone number2" between email and password1 then do I need to add filters on each exact lines

input type='text' name='usersname'
apply_filter('custome_address');   <===== added filter
input type='text' name='email'
apply_filter('custome_phone1');   <===== added filter
apply_filter('custome_phone2');   <===== added filter
input type='password' name='password1'
input type='password' name='password2'

Am I doing right? or something wrong? It could be a too easy question but I just want to make sure.

One more short question: after this form, how can I handler register processing page? it should be added for saving database.

share|improve this question
1  
Actions and filters are used to allow other programmers to add code to existing code without editing that existing code. This allows WordPress code to be modified without editing it and it allows WordPress to be updated without modifying the code that added by the filter or the action that added the custom code. There is a 3 step example of adding a First Name form field to the registration form in the Customizing the Registration Form article on WordPress Codex. –  Charles Clarkson Sep 21 '13 at 16:03
1  

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.