Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to Change Mystery Man Graphic without Overwriting Core Image File [Trac Denied]

  • @frank13

    Member

    I am using Sarah Gooding’s workaround to replace the core mystery man graphic with a custom graphic. It does not work. It continues to render the core mystery man graphic.

    Has anyone had any success overwriting the mystery man graphic?

    // Source: http://wpmu.org/how-to-add-a-custom-default-avatar-for-buddypress-members-and-groups/
    function myavatar_add_default_avatar( $url ) {
    return get_stylesheet_directory_uri() .'/images/mystery-man.jpg';
    }
    add_filter( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );

    Tried this too (got it form http://etivite.com/api-hooks/buddypress/trigger/apply_filters/bp_core_mysteryman_src/). It did not work either:
    apply_filters( 'bp_core_mysteryman_src', 'myavatar_add_default_avatar' );

Viewing 10 replies - 1 through 10 (of 10 total)
  • @aces

    Participant

    It’s not quite the same thing but with bp version 1.5.6, I use the following in bp-custom.php:

    
    // see: https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/1-5-group-avatars-using-mystery-man-default#post-109448
    function my_avatar_defaults() {
    global $bp;
    // change 'identicon' to anything listed here:
    // http://en.gravatar.com/site/implement/images/#default-image
    $bp->grav_default->group = 'identicon';
    $bp->grav_default->user = 'monsterid';
    }
    add_action( 'bp_init', 'my_avatar_defaults' );
    

    @frank13

    Member

    @aces. I am looking through your response. Where do I define the location of my Mystery Man graphic inside your code solution?

    I have it located at `../wp-content/themes/my-theme/images/mystery-man.jpg`

    @aces

    Participant

    The link within the post above ( http://en.gravatar.com/site/implement/images/#default-image ) has more information about what you want to do….

    @frank13

    Member

    Awesome @aces…I think we are getting closer…Do you know where I insert <img src="http://my.BuddyPress_site.com/wp-content/themes/my-theme/images/mystery-man.jpg" /> ?

    Do I place it all by itself in my functions.php file? If I do (being a PHP coder) I know a stray html tag will show that image on every page. I need to somehow wrap it around a do_action() or and add-action() or an add-filter() or an add_filters() — I believe, as I learn more about hooking in WordPress/BuddyPress.

    Thanks for guiding me on what to most out there is such a simple replacement to the out-of-the-box Mystery Man image graphic.

    @frank13

    Member

    any BP mystery men experts out there?

    @r-a-y

    Keymaster

    Sarah Gooding’s example should work. Though it’s missing one step, you have to login to the WP admin dashboard and navigate to “Settings > Discussion”.

    Next, under “Avatars”, select “Mystery Man” and save. Now, the code snippet should take effect.

    @frank13

    Member

    My Avatar Default was set already to Mystery Man.

    So let me ask this…

    Maybe it is not overwriting because it already saved the mystery man avatar to their profile? Is that what is happening?

    I am trying to get BuddyPress to use my default avatar for all instances where the member has not yet loaded a picture (or avatar). But maybe my thinking is wrong…

    Please confirm that I can or cannot overwrite the mystery man avatar, at anytime, on the fly?

    Thanks @r-a-y !!

    @frank13

    Member

    Has anyone had any success substituting the `Mystery Man` graphic by placing it in non-core or non-plugin directory without actually replacing the actual out-of-the box graphic?

    I am trying to avoid having my custom Mystery Man graphic get overwritten if/when I do an upgrade to BuddyPress.

    Thanks.

    @frank13

    Member

    Any Guru’s out there? I think the ability does not exist so I created a Trac enhancement ticket request.

    @frank13

    Member

    Ok, I got to the bottom of this (sort of).

    My need and request ends up being a duplicated need requested 3 years ago (see https://buddypress.trac.wordpress.org/ticket/501)

    So it looks like we have to live with the static Mystery Man graphic hard coded into BP.

    The work around is to overwrite the BP Mystery Man graphic each and every time you upgrade your BP.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘How to Change Mystery Man Graphic without Overwriting Core Image File [Trac Denied]’ is closed to new replies.
Skip to toolbar