Support » Plugin: Who's Online » I need help changing the profile links in this plugin

  • Resolved dubbinz

    (@dubbinz)


    Hi I noticed that it says you added a filter for this in the php file or at least I think that’s what it meant in the updates and I found the function but I just don’t understand what I need to change.

    I need to change the /author/ link in the widget to /members/ to match buddypress links. I am assuming it is this code I need to change right?

    * Return HTML for a single blog user for the widget.
     *
     * @uses apply_filters() Calls 'wpwhosonline_author_link' on the author link element
     * @return string HTML for the user row
     */
    function wpwhosonline_user( $last_online_ts, $user ) {
    	$avatar = get_avatar( $user->user_email, 32 );
    	$name = $user->display_name;
    	$link = '<a href="' . get_author_posts_url( $user->ID, $user->user_nicename ) . '" title="' . esc_attr( sprintf(__("Posts by %s"), $user->display_name) ) . '">' . $name . '</a>';
    
    	$link = apply_filters( 'wpwhosonline_author_link', $link, $user );

    where exactly do I edit and how would I edit this link (if in fact this is what it does, I am not php fluent at all)

    http://wordpress.org/extend/plugins/wp-whos-online/

Viewing 4 replies - 1 through 4 (of 4 total)
  • I need this help as well, for me I only need it to be pointed to bbPress author link.

    The plugin author mentioned a code to insert in functions.php but my tries did not work to have the bbpress autor link work. Here’s the code he mentioned if this will help…

    function mytheme_whosonline_link( $link, $user ) {
        return '<a href="/user/' . $user->user_login . '">' . esc_html( $user->display_name ) . '</a>';
    }
    add_filter( 'whosonline_author_link', 'mytheme_whosonline_link', 10, 2 );
    Plugin Author Annika Backstrom

    (@abackstrom)

    I don’t have BuddyPress set up, but it looks like there’s a bp_core_get_userlink() function. Try this:

    function my_userlink( $link, $user ) {
        return bp_core_get_userlink( $user->ID );
    }
    add_filter('wpwhosonline_author_link', 'my_userlink', 10, 2);

    Untested!

    Thanks Adam,

    I tried this and seems to work, just need some tweaking especially for me to have this work in bbpress user profile.

    Thanks a lot!

    @joetheinsider did you get this one working for bbpress?
    and if yes, what did you do?

    I’d like the user-link in the widget lead to the user profile in wordpress 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘I need help changing the profile links in this plugin’ is closed to new replies.