There are a whole series of constants in bp-core-avatar.php that may be overridden, not sure what the constant you mention ‘CORE_MAX_FILE_SIZE’ is
It defines the sizes of the avatars, large and medium, I’ve set medium to be slightly larger than the original. But I don’t like modifying the core.
Why don’t these work or am I missing the point .
`define ( ‘BP_AVATAR_FULL_WIDTH’, 350 );
define ( ‘BP_AVATAR_FULL_HEIGHT’, 350 );`
same for thumbs, also of course one can pass size params back on avatar calls.
Thats how I’ve worked it in the example, but I have to go into plugins/buddypress/ directory to edit that, I want to know if I can copy those parameters over to my functions.php and overwrite the core buddypress ones.
Know what I mean? I have other functions/declarations that I would like to overwrite, this is just one example
Those are constants, the whole point of them is that you can set them yourself and override the BP ones as the bp ones check to see if they are defined first somewhere. Try it ou, either in bp-custom.php or functions.php
Ok I will have a go, I’ll post back my results, cheers!
Tried pasting the function int my themes functions.php but no joy, hm..
Functions.php is too late. Use bp-custom.php or wp-config.php.
I need it in my theme though, so when I distribute it the file will reset the original function
If I create a bp-custom.php in my theme directory will it work then??
No bp-custom.php has to run from plugins folder.
As much as one would expect functions.php to be too late in the proceedings to set a constant that is read it did/does actually work for me to change my user avatars ??
This issue of being able to effect default ‘stuff’ from themes does crop up from time to time, ideally a method that could ensure things could always be set from functions.php would be great but not sure how or if that is possible with something like Constants which by definition have to be set at earliest opportunity.
I see, thanks for the info guys!
@DJPaul Interestingly?
in my browser output:
`
`
width/height attributes having been set in functions.php:
`
define ( ‘BP_AVATAR_FULL_WIDTH’, 450 );
define ( ‘BP_AVATAR_FULL_HEIGHT’, 450 );
`
So it seems as the call for the avatar is a function with params in membere-header.php `bp_displayed_user_avatar( ‘type=full’ )` we are actually forcing conditions to be re parsed and thus picking up my constants in functions.php? however I expected to see somewhere in ‘bp-core-avatars.phh or ‘bp-members-template.php’ a point at which we check for the constants again after the initial setting of them but failed to work out how the function ‘bp_displayed_user_avatar( ‘type=full’ )’ is actually reading the constant. Either I am mis-understanding what’s happening here or I scanned code too quickly and missed what I was looking for.