Skip to:
Content
Pages
Categories
Search
Top
Bottom

Current URL

  • Avatar of James
    James
    Participant

    @janismo

    hi,

    How do I get current url of any BP page/component/etc..?

    e.g., native WP get_permalink for example.com/username/profile/ shows example.com/members.

    what should be used instead?

    Edit:
    don’t know how bad this method is, but `$_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]` worked fine for me. From my unprofessional point, central wrapper would be easier :)

    P.S. Lost some minutes, because of “It looks like you’ve already said that!” – strange behavior + small mistake with you’ve.

    thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Avatar of @ChrisClayton
    @ChrisClayton
    Participant

    @chrisclayton

    BuddyPress uses different functions for different components,
    “ will echo the current (displayed) profile’s url (used in your example)

    I wonder if we do need a central wrapper function for this type of thing or not.

    Avatar of @ChrisClayton
    @ChrisClayton
    Participant

    @chrisclayton

    @djpaul – i was actually thinking the same thing after i wrote the above, just testing a patch before adding it to trac for feedback.

    BTW, we need to be more consistant… why do we use displayed_user for the displayed user but we use current_group for displayed group ect.?

    Probably just because how it was written three years ago. If you’ve got a time machine handy… ;)

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

You must be logged in to reply to this topic.