Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/19/2016 06:04:47 PM (9 years ago)
Author:
r-a-y
Message:

URI: Support members shortlink redirection.

This commit redirects /members/me/* to /members/LOGGEDIN_USER_SLUG/*.
If root profiles is enabled, then this redirects /me/* to
/LOGGEDIN_USER_SLUG/*. If a user is logged out, /me/ redirects to the
login page and when properly authenticated, will redirect back to the
logged-in user's page.

This will allow devs to create dynamic links to a user's profile, which is
useful for all sorts of things -- nav menus, support links, etc.

Props r-a-y, dcavins.

Fixes #6325.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/routing/members.php

    r9914 r10791  
    109109        $this->assertTrue( is_404() );
    110110    }
     111
     112    /**
     113     * @ticket BP6325
     114     */
     115    function test_members_shortlink_redirector() {
     116        $shortlink_member_slug = 'me';
     117
     118        $this->go_to( bp_get_members_directory_permalink() . $shortlink_member_slug );
     119
     120        $this->assertSame( get_current_user_id(), bp_displayed_user_id() );
     121    }
    111122}
Note: See TracChangeset for help on using the changeset viewer.