Show Sidebar Log in
Commons In A Box Logo
  • Home
  • About
    • Project Team
    • Logos and Graphics
  • Showcase
    • CBOX Classic Showcase
    • CBOX OpenLab Showcase
  • Demo
  • Get Started
  • Documentation
    • Technical Guide
    • CBOX Classic Guide
    • CBOX OpenLab Guide
  • Support Forums
    • CBOX Classic
    • CBOX OpenLab
    • Developers Forum
  • News

Group Admins

  • Profile picture of Scott Voth

CBOX OpenLab Support

Public Group active 1 year, 1 month ago

Have a question about Commons In A Box OpenLab, our new platform for open learning? Join the group and post your question here. Register for an account or log in to commonsinabox.org, then join the group and post your question here.

Updating default avatar

  • This topic has 5 replies, 3 voices, and was last updated 1 year, 1 month ago by S.G..
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • November 1, 2021 at 2:23 pm #9076
    S.G.
    Participant

    Apologies if this has been asked before, though I didn’t see it when I searched!

    To update the default/empty avatar placeholder from the cbox logo to our own OL logo, is there another way besides swapping the multiple files in the cbox OL core plugin?

    Thanks!

    November 1, 2021 at 2:54 pm #9077
    Ryan Seslow
    Participant

    Hi S.G, – Im taking a peek at this now – back soon – Ryan

    November 1, 2021 at 3:17 pm #9078
    Ryan Seslow
    Participant

    Having a bit of trouble as well, Im going to default to Bree & Ray on this.

    November 1, 2021 at 7:59 pm #9079
    Ray
    Keymaster

    Yes, it’s possible, but this is not an admin dashboard option at this time. You’ll have to write some code so you can use your own custom default avatars.

    This is where OpenLab sets the default avatar:
    https://github.com/cuny-academic-commons/cbox-openlab-core/blob/27913ac024f96dd31eac6887423650581e49820f/includes/brand-settings.php#L158-L179

    So you can do something similar:

    function my_custom_default_avatar( $size = 'full' ) {
    	$size_suffix = 'full' === $size ? '-full' : '-thumb';
    	return 'URL OF YOUR DEFAULT AVATAR';
    }
    
    add_filter(
    	'bp_core_avatar_full',
    	function( $full ) {
    		return my_custom_default_avatar( 'full' );
    	},
    	20
    );
    add_filter(
    	'bp_core_avatar_thumb',
    	function( $thumb ) {
    		return my_custom_default_avatar( 'thumb' );
    	},
    	20
    );

    Replace ‘URL OF YOUR DEFAULT AVATAR’ with the URL where your default avatar is located.

    Notice the 20 in the code above. This means that this code will have higher priority than the code in OpenLab.

    Put it in the other code snippets you have in place in wp-content/mu-plugins.

    Let me know if you have any questions.

    November 3, 2021 at 3:02 pm #9082
    S.G.
    Participant

    Thanks very much–I’ve passed this on to Chris.

    April 1, 2024 at 9:23 pm #9232
    S.G.
    Participant

    Hi everyone,

    Perhaps this option has been added to the admin dashboard in a subsequent release, because I came across it and updated our avatar.

    Just leaving the path here in case others are interested: appearance, customize, logos, Default Profile Photo.

     

     

  • Author
    Posts
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Log In
Group logo of CBOX OpenLab Support
  • Home
  • Forum
  • Announcements
  • Docs
  • Members 22
  • Send Invites

Groups

Newest | Active | Popular | Alphabetical
  • Group logo of CBOX Classic Support
    CBOX Classic Support
    287 members
  • Group logo of CBOX Pioneers
    CBOX Pioneers
    71 members
  • Group logo of CBOX Developers
    CBOX Developers
    40 members
  • Group logo of CBOX OpenLab Support
    CBOX OpenLab Support
    22 members
  • Group logo of CBOX-OL Testing Partners
    CBOX-OL Testing Partners
    12 members

CBOX has its roots in the CUNY Academic Commons, which in turn was made possible through funding from The City University of New York itself.

CUNY Logo

CUNY Academic Commons Logo

City Tech logo

The Commons In A Box was made possible through the generous support of the Alfred P. Sloan Foundation.

Alfred P. Sloan Foundation Logo

NEH Logo

The CUNY Graduate Center has directly contributed to the CUNY Academic Commons, housing the project since its inception, and has contributed to CBOX through its GC Digital Initiatives.

CUNY Graduate Center Logo

CUNY Graduate Center Digital Initiatives Logo

Powered by Commons In A Box
css.php
Skip to toolbar
  • About WordPress
    • WordPress.org
    • Documentation
    • Learn WordPress
    • Support
    • Feedback
  • Log In
  • Register