[Pro Sites] [Pro Sites] Setup Your Site Form

After choosing a subscription level a "Setup Your Site" form appears. 1.) It look aweful, and 2) We would like to add more form fields (questions) to this form.

1) Where would I go to access this form and style it and add more form fields to it?

2) How would I hook into this form so that I can send it's information (webhook) off to a differet database (customer management backend)

Thanks.

  • Ash
    • WordPress Hacker

    Hello Deryk

    1) Where would I go to access this form and style it and add more form fields to it?

    Pro Sites uses the default wordpress registration form and it adopts the generic style from the theme. So, there is no option to make more fields into that form I am afraid. You can use a multisite registration form builder and use that as a registration form. Or, you can use buddypress which have a xprofile form builder that can be used to create extra fields.

    2) How would I hook into this form so that I can send it’s information (webhook) off to a differet database (customer management backend)

    You can use the default wordpress hook: wpmu_new_user. Here it is in source: https://core.trac.wordpress.org/browser/tags/3.5.1/wp-includes/ms-functions.php#L923

    Hope it helps! Please feel free to ask more questions if you have any.

    Have a nice day!

    Cheers,

    Ash

  • Deryk
    • The Incredible Code Injector

    Greetings.

    So. I am using the Gravity Forms User Registration Add on to create the registration form for this multisite.

    My question: The default forms adds blog name and blog title to the registration form. Of course I can create these fields also in gravity forms, but is there something I need to know in order to tie these fields in?

    Thanks.

  • Deryk
    • The Incredible Code Injector

    Okay. So it looks like the Gravity Forms Registration Add on does NOT actually mess with the wordpress registration, but instead creates a feed that hooks into the wordpress registration. Is there ANY way that I can replace (here – http://prntscr.com/nd6ltt) Your grab of the registration form with my gravity forms registration form?

    Also – I have Signup on Checkout checked. The subtext of this option states “Disables WordPress Signup” (http://prntscr.com/nd6mok) So am I actually still using the Default WP Registration form?

    Thanks

  • Deryk
    • The Incredible Code Injector

    Ok. this is getting wicked frustrating. Even RegistrationMagic does not work to fix this problem.

    From Blog Templates page (http://whiteroofmarketing.com/sample-page/) when I click on a template, I am taken to /wp-signup.php/ which does not seem to be a hook for registration redirect for either Gravity Forms OR RegistrationMagic. Now if I go to /wp-admin/ and click the registration button, I THEN go my new RegistrationMagic signup page?! So why does blog template send to, and not give the option to change?

    Again – HOW DO I CHANGE MY REGISTRATION PAGE FOR PRO SITES FLOW OF ONBOARDING!?

    Additionally, If I use “Signup on Checkout” Which is what I WANT to use, the system does NOT appear to be using the default registration form according to the code (http://prntscr.com/nd82f4). If it IS pulling this in, shouldn’t there be a hook I can access to change this? Or in the least, a template somewhere that I can style?

  • Nithin
    • Support Wizard

    Hi Deryk,

    Again – HOW DO I CHANGE MY REGISTRATION PAGE FOR PRO SITES FLOW OF ONBOARDING!?

    Sorry to hear about the ongoing issue. Pro Sites utilises the default WordPress fields used for the blog title and blog name. So, it should be the same for Gravity Forms too.

    However, please do note that there isn’t any out of the box integration for Gravity Forms in Pro Sites, and it would require a lof custom coding if you are looking to integrate Pro Sites workflow within Gravity Forms.

    Pro Sites handles registration and all the dynamic action within one single page, and I’m afraid what could be done regarding this is limited when it comes to hooks, and might require editing the plugin core files.

    I’m checking with the developer to see whether he could advise any hooks that could be utilised, and help guide you further. Will keep you posted once I get feedback regarding this asap.

    Also – I have Signup on Checkout checked. The subtext of this option states “Disables WordPress Signup” (http://prntscr.com/nd6mok) So am I actually still using the Default WP Registration form?

    As mentioned before the Pro Sites uses the default fields, and variables regarding registration. The setting is more specific to the Pro Sites plugin. This disables the signup via the checkout page of Pro Sites, and users will have to log in to create new subsites via Pro sites checkout page in such instance.

    Regards,

    Nithin

  • Panos
    • SLS

    Hi Deryk !

    From what I read you would like to be able to use a Gravity Forms form in Pro Sites checkout page. This could be possible but it requires custom coding that exceeds the scope of our support forum. However I have prepared some custom snippet that can be used as a guide. Making changes on that snippet won’t be that simple, so if you are not a developer I would suggest to hire one for this.

    You can find and download the snippet from here :

    https://gist.github.com/wpmudev-sls/26bdfcf9be903e14acb0a3b9a9924dc5

    After unziping it you can use the ps-custom-checkout-fields.php file as a mu-plugin, uploading it to your wp-content/mu-plugins folder on your WordPress installation. If that folder doesn’t exist you can simply create it.

    This snippet does 2 things :

    1. It can add custom fields in the checkout page. It supports textboxes,checkboxes and single dropdowns. You probably won’t needs this as you are interested in using GF

    2. Those fields also support shortcodes. That means that you can use that field and add your GF shortcode.

    Additionally in that snippet, I am hiding and removing the default Pro Sites fields. That means that in your GF form the minimum fields you need to include are for:

    Username,

    User email,

    Site slug/subdomain/subfolder. In Pro Sites it’s the field that says Your Site,

    Site name

    Lets try explain which parts of the snippet do what and what is to change. It needs to be careful and always make changes in a testing/staging site before moving file to your live site.

    1. The new fields

    Find this line private static $site_fields. This variable is and array which contains all the additional fields you want to print at the site section of the checkout page. In my demo in that snippet, I am adding 3 fields:

    a ) a field I named site_category, it’s a dropdown

    b) a field named site_audience, for checkbox demo

    c) and a field named gravity_form. This is a field with type set to shortcode and contains my gravity form’s shortcode.

    You can delete a and b as you only need the GF shortcode. In c) you need to replace my shortcode with your form’s shortcode.

    2. How to replace the Pro Sites fields values

    As I mentioned in the snippet I am removing the default fields of Pro Sites in the checkout page. This happens in these actions:

    add_action( 'wp_head', array( $this, 'print_header_scripts' ) );
    add_action( 'wp_footer', array( $this, 'print_footer_scripts' ) );

    That means we need to fill in those missing fields with ones from your GF form. For that we use this variable:

    private static $switch_fields

    In GF, you will notice that the fields have a name input_[the field id]. You can get those fields names in the checkout page by right-clicking on them and use the inspect tool of you browser. Now make sure you replace the correct field names in that variable, eg, if the field for username is input_14, then change

    'user_name' => 'input_1',

    to

    ‘user_name’ => ‘input_14’,`

    Mind the commas in each change

    <strong>3. Use the additional fields on new site creation</strong>

    The additional fields’ values are stored in the signup table in db, at the meta column. This takes place at this method:

    public function additional_meta( $signup_meta ) {

    So all you need to do, is use that meta when the site is being activated. This happens in this method:

    public function activate_blog( $blog_id, $user_id, $password, $signup_title, $meta ) {

    There I have a sample for how to use a specific meta, with filed name <em>input_8</em>. In my example, in my additional fields, this is the Dropdown with the list of Themes. So I would need to get the value of <em>input_8</em> from the signup meta and use it to switch the theme in my new site. You can see this in that method here :

    if ( 'input_8' == $meta_key ) {
    switch_to_blog( $blog_id );
    switch_theme( $meta[ $meta_key ] );
    restore_current_blog();
    }

    I think I covered most of the things need to be done. They are not that complicated but it would be better to have a developer doing this as some custom fields might not be so simple to use. We have partnered up with codeable where all members have a discount on their first project:

    https://premium.wpmudev.org/partners/#wpmud-hg-discounts-services

    Hope this helps!

    Kind regards!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.