BuddyDev

Search

[Resolved] Submit Button on Register Page

Tagged: 

  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34562

    Hello,

    I’m looking at /plugins/buddypress/bp-templates/bp-nouveau/buddypress/members/register.php file.

    There is a submit button on this register page and I can’t find what this triggers. After this button is pressed what functions are run and how is it committed to the DB.

    What I want to do is copy this into a child theme and make some changes for a secondary register page and make some customizations and possibly some backend changes as well.

    Can someone step me through the process?

    Thanks in advance

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 3115
    Ravi on #34567

    Hello Mark,

    Welcome to the forum. Function with name “bp_core_screen_signup” handle the registration process. Please take a look and let me know if you need further help.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34596

    Hello Keymaster, thank you for the reply. How does the form know to call the “bp_core_screen_signup” button on submit. I don’t see that function referenced anywhere on the page.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #34601

    Hi Mark,
    The function ‘bp_core_screen_signup’ is hooked via ‘bp_screens’ which runs on all front pages. The function checks if the request is for registration post submission and handles that.

    If you are trying to create a different workflow, you will need to create your own form renderer as well as form submission handler.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34611

    Ah, it looks like I’m missing some basic knowledge.

    When I go to my-site.com/register, how does that get rendered? How does bp_screens work?

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #34630

    Hi Mark,
    Are you familiar with WordPress actions/filters? The actions are events which are fired when something happens.The callbacks are functions which gets called on these events.

    bp_screens is one of those custom events created/triggered by BuddyPress which allows us to handle some front end actions.

    In this particular case, the handler for registration is attached to that action.

    Like I suggested in my previous reply, if you are trying to create a custom workflow, you will need to handle the form rendering and submission both.

    You can use the register.php code and code from the signup submission handling as example and make a copy of them(rename the functions) and modify.

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34638

    Ah, this gives me 2 questions. I know a little about actions/filters, but still a little fuzzy on how pages load in WordPress.

    1. What does buddypress first call when a user navigates to mysite.com/register, or even if they go to a random page like mysite.com/register22. I feel like this is important for me to understand. What’s the first .php to run or file to run?

    2. I tried copying the register.php into my child themes root folder, but the page only showed blank. I followed an old post and moved it to child-theme/buddypress/members and worked. What’s preventing me from directly putting it into my child-theme root folder?

    • This reply was modified 3 years, 11 months ago by Mark Carter.
    • This reply was modified 3 years, 11 months ago by Mark Carter.
  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34648

    I’ve copied the register.php code but it is not working fully.

    Here are my steps so far.

    1. Created child theme “astra-child”
    2. Copied register.php into astra-child/page-register2.php
    3. my-site.com/register2 now loads fully only if I change <?php if ( 'request-details' === bp_get_current_signup_step() ) : ?> to <?php if ( true ) : ?>. Otherwise only changes outside the if will show.

    How do I get the bp_get_current_signup_step() to work so the form displays.

  • Keymaster
    (BuddyDev Team)
    Posts: 24593
    Brajesh Singh on #34652

    Hi Mark,
    to answer your earlier questions:-

    
    1. What does buddypress first call when a user navigates to mysite.com/register, or even if they go to a random page like mysite.com/register22. I feel like this is important for me to understand. What’s the first .php to run or file to run?
    

    BuddyPress checks that is it the registration page as set in BuddyPress settings. If it is, the theme compatibility kicks in and the content of that page(using the_content filter) is replaced with the actual BuddyPress registration template.

    
    2.  I tried copying the register.php into my child themes root folder, but the page only showed blank. I followed an old post and moved it to child-theme/buddypress/members and worked. What’s preventing me from directly putting it into my child-theme root folder?
    
    

    It should go to your-child-theme/buddypress/members directory if you wnat to override the default one.

    For more details on handling, Please check plugins/buddypress/bp-members/screens/register.php

    Regards
    Brajesh

  • Participant
    Level: Initiated
    Posts: 9
    Mark Carter on #34682

    Thanks Brajehs, this has pointed me in the right direction. I have a little more research to do, but the bp_screens has definitely helped!

You must be logged in to reply to this topic.

This topic is: resolved