Skip to:
Content

bbPress.org


Ignore:
Timestamp:
01/18/2011 08:35:34 AM (15 years ago)
Author:
johnjamesjacoby
Message:

Introduce lost password page. Introduce user_login and user_lost_pass template parts. Introduce supporting login and smart login redirect functions. Normalize submit containers across template forms. (@todo: register, activation, and lost password pages)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-general-functions.php

    r2810 r2815  
    996996}
    997997
     998/** Login *********************************************************************/
     999
     1000/**
     1001 * Change the login URL to /login
     1002 *
     1003 * This assumes that your login page is 'domain.com/login'
     1004 *
     1005 * @todo Make this less janky
     1006 *
     1007 * @uses apply_filters()
     1008 * @uses trailingslashit()
     1009 * @uses home_url()
     1010 * @return str
     1011 */
     1012function bbp_login_url( $url = '', $redirect_to = '' ) {
     1013    return apply_filters( 'bbp_login_url', trailingslashit( home_url( 'login' ) ) );
     1014}
     1015
     1016/**
     1017 * Change the logout URL to /login and add smart redirect
     1018 *
     1019 * This assumes that your login page is 'domain.com/login'
     1020 *
     1021 * @todo Make this less janky
     1022 *
     1023 * @uses apply_filters()
     1024 * @uses add_query_arg()
     1025 * @uses trailingslashit()
     1026 * @uses esc_url()
     1027 * @uses home_url()
     1028 * @return str
     1029 */
     1030function bbp_logout_url( $url = '', $redirect_to = '' ) {
     1031    if ( !$redirect_to = home_url( $_SERVER['REDIRECT_URL'] ) )
     1032        $redirect_to = $_SERVER['HTTP_REFERER'];
     1033
     1034    if ( empty( $redirect_to ) )
     1035        $redirect_to = home_url( $_SERVER['REQUEST_URI'] );
     1036
     1037    $url = add_query_arg( array( 'redirect_to' => esc_url( $redirect_to ) ), $url );
     1038
     1039    return apply_filters( 'bbp_logout_url', $url );
     1040}
     1041
    9981042?>
Note: See TracChangeset for help on using the changeset viewer.