Skip to:
Content
Pages
Categories
Search
Top
Bottom

Current URL

  • @janismo

    Participant

    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)
  • @chrisclayton

    Participant

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

    @djpaul

    Keymaster

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

    @chrisclayton

    Participant

    @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.?

    @djpaul

    Keymaster

    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)
  • The topic ‘Current URL’ is closed to new replies.
Skip to toolbar