Skip to:
Content
Pages
Categories
Search
Top
Bottom

get_user_profile_link bug?

  • Hello,

    I’m writing some plugin for rewriting url for user’s profiles.

    I have some code:

    add_filter('get_user_profile_link', 'ss_get_user_profile_link');

    function ss_get_user_profile_link($link, $id = 0) {

    $user = bb_get_user(bb_get_user_id($id));

    $r = bb_get_option(‘uri’) . ‘profile:’ . $user->user_nicename;

    return $r;

    }

    When ss_get_user_profile_link get control, there is $id = 0 always. Why?

    Thanks.

Viewing 1 replies (of 1 total)

  • Sam Bauers
    Participant

    @sambauers

    The filter will only be passed one argument by default, so you need to change your add_filter() call to this:

    add_filter('get_user_profile_link', 'ss_get_user_profile_link', 10, 2);

    .

    The third parameter is the priority, the second is the number of arguments to pass.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.