This entry is part 2 of 22 in the Customizing Restrict Content Pro Series
- Mail Chimp for Restrict Content Pro
- Add Custom User Meta Fields to Restrict Content Pro Registration
- Removing “Restrict This Content” Meta Box in Restrict Content Pro
- Restrict Content Pro – Campaign Monitor
- Restrict Content Pro – Graphs
- Restrict Content Pro – Stripe Payment Gateway
- Hide wp-login.php with Restrict Content Pro
- Add a Agree to Our Terms of Use Field to Restrict Content Pro
- Template Files in Restrict Content Pro
- Template Files in Restrict Content Pro
- Adding Custom User Fields to Restrict Content Pro
- Custom Capabilities in Restrict Content Pro
- Custom Capabilities in Restrict Content Pro
- Restrict Content Pro – Enforce Strong Passwords
- Restrict Content Pro – Braintree Gateway
- Restrict Content Pro – WP Job Manager Bridge
- Restrict Content Pro – Download Monitor Bridge
- Restrict Content Pro – Wysija Add On
- Restrict Content Pro – CSV User Import
- Restrict Content Pro – Affiliates Add-On
- WP Push Releases Restrict Content Pro Extension
- Restrict Content Pro – Math Verification
Restrict Content Pro is my premium content plugin that makes it very easy to sell subscriptions to your WordPress website. It is the plugin that powers the subscription system to this site. This subscribers’s only tutorial is going to walk you through the process of adding new form fields to the registration form, and then storing the data enter in those fields in the user’s meta. I will also cover how to output the newly acquired information in the Members page of the plugin admin section.
A new version of this tutorial is available that is more up to date. View it.
The gist of what we are going to be doing in this tutorial can be see in the two screenshots below:
The complete code written in the video is below:
Code removed. Please see the updated tutorial.
Hi,
Is it possible to create multiple registration froms for different custom role for my project in WP with user meta, and at the same time i need customize the form with my own CSS.
when user login we need give update they profile with profile picture.
please help me
thanks
BA Kumar
Yes, it is possible, but only if you know how to do it by copying the existing form and creating a second one.
There are several plugins out there that allow users to set profile images, but there is not a way included with RCP.
Hi,
Thank you for reply, but i s short. if you have free time please provide detailed explanation.
it very important who search multiple registration forms like me.
please help me
Thank you
Duplicating the forms is not too difficult, but it goes far beyond the scope of the support you get included with the plugin purchase.
where I can add this code?
Your theme’s functions.php or any custom plugin is fine.
i added the code but it’s not working. Location is not showing on back end. How can I fix it. How can I add more field?
now problem has been solved. do you have any option to add moneybookers ? how can i add?
In order to use Money Bookers, you will have to build a custom payment gateway. How comfortable with PHP are you?
Hi, How do I add multiple fields. I was able to add location, but when i copy and alter for a 2nd field I get an error which seems like I can’t add 2 identical hooks:
Fatal error: Cannot redeclare pippin_add_table_header_footer() (previously declared in /home/condo/public_html/condo/wp-content/plugins/custom-functions/custom-functions.php:50) in /home/condo/public_html/condo/wp-content/plugins/custom-functions/custom-functions.php on line 86
Kyle, you have to change the name of the second function/hook. As you noted, they cannot be the same. Just renamed the second pippin_add_table_header_footer() to something else and then also rename it in the add_action().
This modification is great, i’m using to add multiple fields however, another 14 records, which works fine, until I get to the admin section.
All the columns are added, however they get *squashed*, editing the admin-style.css file and adding extra CSS records.. as follows :
.rcp-user-col { width: 100px; }
.rcp-id-col { width: 50px; }
.rcp-email-col { width: 180px; }
.rcp-sub-col { width: 140px; }
.rcp-status-col { width: 70px; }
.rcp-recurring-col { width: 90px; }
.rcp-expiration-col { width: 140px; }
.rcp-role-col { width: 90px; }
.rcp-city-col { width: 70px; }
.rcp-state-col { width: 70px; }
.rcp-country-col { width: 90px; }
.rcp-postcode-col { width: 70px; }
.rcp-phone-col { width: 40px; }
.rcp-mobile-col { width: 40px; }
.rcp-dob-col { width: 40px; }
.rcp-age-col { width: 25px; }
.rcp-sex-col { width: 40px; }
.rcp-parents-col { width: 90px; }
.rcp-hsyear-col { width: 40px; }
.rcp-hs-col { width: 70px; }
.rcp-hsaddress-col { width: 90px; }
.rcp-handicap-col { width: 50px; }
.rcp-actions-col { }
once I get to a certain number the action column completely vanishes and i’m unsure why 🙁
any idea / assistance on why this would be occuring? or is there a different way to view/edit the data?
How many columns do you have with your modified code?
If the answer to that is “Lots and lots” – is there a hook to add fields to the detail view, instead of the list view in the admin area?
And the answer of course is yes. Checking the source I found rcp_view_member_after:
function pippin_add_fields($user_id) { ?>
<?php
}
add_action('rcp_view_member_after', 'pippin_add_fields');
Hope that helps someone. This plugins code really is very well written.
Your code was stripped out, please post again via snippi.com
http://snippi.com/s/kepbxqh
Really the key thing is what the hook is, but yeah. Here is an example of what I’m adding (its actually like 20 fields)
Thanks for reposting!
Using your example of “location”. How would I have the content of that input added to the email that is sent to the admin on submit? Currently it just shows
Whoops that go cut off. Currently one email shows first and last name, the other shows username and email.
Are you familiar with using filters in WordPress?
hi, I am adding like 4 new filed in RCP plugin the way you described above. I have couple of question. First one i want to make my new field required field how can i make my new fields required field. I explored your Member-form.php you are using there like to make field required . i am trying for my flied like function pippin_add_dlic_field(){
?>
but its not wrking.
2nd question when i see my new field in restrict Member area in word press its look weird not with sequence and how can i fetch all field from database by using user id. like i want to see all field info of user. how can i fetch all field from database. thanks Plz reply me asap.
1. To make a field required, you need to check if the data is present when the form is submitted and then set an error if it isn’t. See this tutorial.
2. Can you give me a screenshot? You can’t fetch all the fields at once; each one has to be fetched individually.
here is screen
http://s1278.beta.photobucket.com/user/mian325/media/screen_zps463343cb.jpg.html?sort=3&o=0
1- Plz have look for my new field code for required field
http://snippi.com/s/xt63dtb
2- Here is snap shot of my Members in restrict content pro
http://s1278.beta.photobucket.com/user/mian325/media/screen_zps463343cb.jpg.html
is there any way that i can display my total number of active members by using restrict content pro plugin. I want to display on my page how much member i have now and it will update as member increase. Plz help me how can i do that
I’ve responded to your ticket in the support forum.
I successfully added two new fields to the form – thank you!
My issue: Can you explain how to move the two new fields to display after the Email field and before the Username field? I would like…
First Name
Last Name
Email
Your Company
Phone Number
Username
Password
Password again
Sorry but that is not possible.
Hi, would that be possible by removing action and using copied function like shown in the tutorial with changed order and adding custom function all in a custom plugin?
Copy that question as i’m planning to do this as well. Or am i thinking the false direction?
Alexander
If you edit the register.php template file directly, it is possible now (didn’t used to be): https://pippinsplugins.com/template-files-in-restrict-content-pro/
Hi, When my expired user try to pay subscription again register button does not work. Same if one user get member and decided to pay subscription later. Later he get login and try to pay by paypal by clicking on register button he cant pay.. register button dont go to paypal page. Please let me know what is wrong.
Please open this as a support ticket: http://support.pippinsplugins.com/forums/forum/restrict-content-pro/
This tutorial is not the place to ask for support.
Can the user then update this meta information or is it only on registration?
It is possible to make that happen but the code is this tutorial does not make that possible.
I solved this by using the “User Meta Manager” plugin by simply adding the new meta fields. Worked straight away without any fuss so users can now go their profile page and update the fields.
Great!
How do I remove the auto renew tickbox and as default have it not to auto renew (I am only offering free subscriptions)?
Post this in the support forums and I’ll be happy to help.
Great video. I’m currently setting up a site based on your plugin and this is pretty much a perfect tutorial for the customization I need to do.
Thanks!
Hello everybody,
If all need an example with more fields can check this link: http://pastebin.com/DWTwErQe
Thanks, and Have Fun !
Dan Ikhim,
Thanks for the code!
But how can I make the fields ‘Required’?
TIA
That goes beyond the scope of this tutorial, but I would suggest you look into the WP_Error class: https://pippinsplugins.com/intro-to-wp-error/
Mr Ikham
Dan
Thanks for making that code available, I used it on a site I am creating and it was exaclty what I was looking For
Tom Bohan
Great video, but for some reason I’m seeing a different file structure in the plugin when I try to add fields. For instance, the HTML for input fields shown in the video as being in member-forms.php seem to be in register.php, and I can’t seem to find handle-registration-login.php. Assuming the plugin been changed quite a bit since this video was released, would it be possible to get an updated how-to video?
Thanks for the note. I do need to update the video.
If you’re unable to find something, just let me know and I can tell you where it is.
I followed all the steps but I don’t know where to add the code in my Restrict Content Pro plugin. Does anyone know where to add it?
Hello! I followed the tutorial but I still don’t know where I am supossed to add the code to in my Restrict Content Pro plugin. Does anybody knows where I need to add it to?
Hi! I just found the solution. I got it from the other tutorial about terms and conditions. Thanks anyway.
Great!
Hey, I’m trying to figure out where to edit this code but I don’t know which php file it is. Ultimately I’m trying to take out a field that was put in by another developer.
Check this page out: http://intlarrivalswholesale.com/?page_id=2737
Resale/Tax ID is the field I’m trying to get rid of.
Funny thing is that I don’t have a membersform.php file.
Thanks in advance.
Create a custom plugin with Pluginception then place the code in that plugin: http://wordpress.org/plugins/pluginception/
Hey Pippin,
Thanks for the tutorial. Love these. Question: I have added some items to my registration form. Validation is working and appearing within the admin section, etc. I have also added these items to appear on the profile editor form. My problem is getting them to update when the user makes a change. Is there an easy fix for this?
Thanks again!
Jim
I saw your ticket in the support forums and will continue to assist you there.
Hi, i`m with the same problem of Jim Sherwood. The registration form is working and the data is saved. But on profile editor, the data isn`t updated. Can you help Pippin? Thanks!
Just your custom data or the default user data too?
Hey Pippin
Is it possible to display different custom fields depending on which membership level is chosen?
It is, though it’s a little tricky. Are you familiar with jQuery?
Good morning,
if you don’t mind to help out as i would need that solution as well. I already used to code little bit of jquery and would appreciate if you could show how this can be done via jquery.
I also have 3 different levels and only need on pro the full field setup.
Julian
Do you already have the fields added that you need?
Yes i do, just hiding them with css would lead to an error i think as they are still there.
So how can i choose the fields that should relate to the fields.
The clicking of the subscription will be the event and then?
Any help much appreciated
Hey Julian,
I made this to do something similar to this (I needed to uncheck the renew box on a certain subscription):
jQuery(document).ready(function(){
jQuery(“.rcp_subscription_fieldset input”).ready(function () {
jQuery(‘input:checkbox[name=rcp_auto_renew]’).attr(‘checked’,false);
});
jQuery(“.rcp_subscription_fieldset input”).click(function () {
jQuery(‘input:checkbox[name=rcp_auto_renew]’).attr(‘checked’,true);
});
jQuery(“#rcp_subscription_level_1 input”).click(function () {
jQuery(‘input:checkbox[name=rcp_auto_renew]’).attr(‘checked’,false);
jQuery( “#rcp_auto_renew_wrap” ).hide();
});
});
This should be a good starting point for what your trying to do if you haven’t already worked it out.
Hi,
maybe i’m thinking in the wrong direction so if you might stop me when this is not possible or may be not a good way to go.
I would like to guide my subscribers after the registration process to a protected member page where the subscriber shall fill out some more fields because all the fields needed to be filled out shouldn’t be asked for with registration that would turn them to leave i guess. Registration should be short and fast. Additional data to construct their profile are to large.
I could go for form builder like ninjaforms what really is a good idea as well but i’d like to gain more knowledge of how which data are processed and knowhow how to code and as your code is state of the art it would be the best way to go in my mind.
So may it be possible that i make a custom plugin where i try to grab the functions that process the [register_form] shortcode and modify them so that these custom functions can process my custom form field data to the appropriate db meta fields?
Am i on a goo or bad road ?
Thank you for patience
Alexander