Skip to:
Content
Pages
Categories
Search
Top
Bottom

bp_blog_avatar Filter?

  • I would like to add a custom avatar on the BuddyPress blogs listing.

    On line #205 of bp-core-avatars.php (http://phpxref.ftwr.co.uk/buddypress/nav.html?bp-core/bp-core-avatars.php.source.html) in the “bp_blog_avatar” function, there is a comment that says, “…you can use a filter with the ID of the blog to change (the avatar) if you wish.” What is the proper code for that filter?

    I would like to have a default avatar for all blogs as well as the ability to apply “my-avatar.jpg” to a blog of ID #4. I have tried some iterations of the following code in functions.php of my theme with no good results:

    `
    add_filter(‘bp_get_blog_avatar_’, ‘my_blog_avatar’);

    function my_blog_avatar () {
    echo bp_get_blog_avatar (
    array(
    ‘item_id’ => 4,
    ‘type’ => $type,
    ‘alt’ => $alt,
    ‘width’ => $width,
    ‘height’ => $height,
    ‘class’ => $class,
    ’email’ => $blogs_template->blog->admin_user_email )
    );
    }
    `

    Thanks!

  • The topic ‘bp_blog_avatar Filter?’ is closed to new replies.
Skip to toolbar