Skip to:
Content

bbPress.org


Ignore:
Timestamp:
08/07/2011 02:07:20 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Add bbp_add_error() and bbp_has_error() functions to handle error adding and checking, and use through-out project. Rejig functions with early GET and POST checks to bail early rather than wrap routine in an if statement. Fixes issue where removing favorites and subscriptions from user profile pages would redirect incorrectly. Fixes issue where spamming and trashing topics and replies would not force view=all in some cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-user-template.php

    r3366 r3382  
    853853    // loggedout was passed
    854854    if ( !empty( $_GET['loggedout'] ) && ( true == $_GET['loggedout'] ) ) {
    855         $bbp->errors->add( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' );
     855        bbp_add_error( 'loggedout', __( 'You are now logged out.', 'bbpress' ), 'message' );
    856856
    857857    // registration is disabled
    858858    } elseif ( !empty( $_GET['registration'] ) && ( 'disabled' == $_GET['registration'] ) ) {
    859         $bbp->errors->add( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) );
     859        bbp_add_error( 'registerdisabled', __( 'New user registration is currently not allowed.', 'bbpress' ) );
    860860
    861861    // Prompt user to check their email
     
    866866            // Email needs confirmation
    867867            case 'confirm' :
    868                 $bbp->errors->add( 'confirm',    __( 'Check your e-mail for the confirmation link.',     'bbpress' ), 'message' );
     868                bbp_add_error( 'confirm',    __( 'Check your e-mail for the confirmation link.',     'bbpress' ), 'message' );
    869869                break;
    870870
    871871            // User requested a new password
    872872            case 'newpass' :
    873                 $bbp->errors->add( 'newpass',    __( 'Check your e-mail for your new password.',         'bbpress' ), 'message' );
     873                bbp_add_error( 'newpass',    __( 'Check your e-mail for your new password.',         'bbpress' ), 'message' );
    874874                break;
    875875
    876876            // User is newly registered
    877877            case 'registered' :
    878                 $bbp->errors->add( 'registered', __( 'Registration complete. Please check your e-mail.', 'bbpress' ), 'message' );
     878                bbp_add_error( 'registered', __( 'Registration complete. Please check your e-mail.', 'bbpress' ), 'message' );
    879879                break;
    880880        }
Note: See TracChangeset for help on using the changeset viewer.