Skip to:
Content
Pages
Categories
Search
Top
Bottom

Template Notice on Registration Error

  • Avatar of techguy
    techguy
    Participant

    @crashutah

    I’ve redone my registration page so the fields to register are lower down on the page. When someone tries to signup and the registration fails (already existing username, too short of a username, etc) then it basically reloads the page and puts those red error messages next to the fields that are in error. This is great, except that it’s too far down on the page if you have a small monitor.

    So, is there any way to post a message to something like ‘template_notices’ whenever the registration fails? Even just a standard message like “There was an error processing your request, please scroll down and fix any errors.” Or even better would be the number of errors that they have.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Avatar of techguy
    techguy
    Participant

    @crashutah

    Seems like this should be a pretty easy one. For some reason, I can’t ever get the template notices to appear when I try to call them. Must be a timing issue of when I call the template notice and then it finally gets displayed.

    Avatar of techguy
    techguy
    Participant

    @crashutah

    It was easy. Luckily I was able to figure it out. Plus I could have done most of it in the theme too. The real key was that I needed to figure out how the errors were being passed on the registration page. Then, I figured they had to be in $bp and they were. Here’s the code I used in bp-custom.php

    function registtration_screen_message_on_error() {

    The message I want to appear for the user.

    }
    add_action( ‘template_notices’, ‘registtration_screen_message_on_error’ );

    To get the errors and only display it if there are errors I used $bp->signup->errors

    Just thought I’d share.

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.