Skip to:
Content
Pages
Categories
Search
Top
Bottom

Advice regarding profile photo and change-avatar.php


  • mike80222
    Participant

    @mike80222

    Hi,

    On our site we have a default image that is used instead of the the user’s normal gravatar, until they set their profile photo. In my functions.php I’ve disabled the standard gravatar upload with

    add_filter('bp_core_fetch_avatar_no_grav', '__return_true');

    and substituted our image with:

    function bp_set_avatar_constants() {
       define(
        'BP_AVATAR_DEFAULT',
        site_url('/wp-content/uploads/default.png')
        );
       define(
        'BP_AVATAR_DEFAULT_THUMB',
        site_url('/wp-content/uploads/default.png')
        );
    }
    add_action('bp_init', 'bp_set_avatar_constants', 2);

    Now the only issue I have is that when you go to upload your photo there is the message “Your profile photo will be used on your profile and throughout the site. If there is a Gravatar associated with your account email we will use that, or you can upload an image from your computer.”

    It would be nice if I could change this to eliminate the part about the Gravatar. I believe this is in: members/single/profile/change-avatar.php

    Do I have any option other than to edit that file directly? Just looking for some guidance here about what is the right thing to do. FWIW, I’m pretty much of a novice with WP in general and certainly with BuddyPress.

Viewing 2 replies - 1 through 2 (of 2 total)

  • Venutius
    Moderator

    @venutius

    There’s two options, you could either overload that file, by placing your edited file in the wp-content/themes/your-child-them/buddypress/members/single directory or the other option is to create your own translation of the BuddyPress text. This last option is preferred, in general overloading files adds to the admin burden as you will need to kepp track of changes in the master file.

    To do the translation you would need to download PoEdit and follow this:

    Languages and Translations

    You just set up a translation of your own language which removes the text.

    Also, to manage translations, use the WPT Custom Mo File.

    This is handy because as you develop your site you are bound to come across other instances in BuddyPress and other plugins where you would prefer to change the text.


    mike80222
    Participant

    @mike80222

    Great. I didn’t realize that (about translations). That sounds very useful. Thanks!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar