Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

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

  • Andrew
    Participant

    @sm60

    @shanebp

    Thanks for the code. It seems to have one problem, but I think I fixed it, it now works for me.

    The code you provided:

    add_action( 'bp_email', function( $email_type, &$email_obj ) {
    	$email_obj->set_from( "custom@example.com", "Custom Website Name" );
    }, 10, 2 );

    This brings up this error right after signing up:
    Warning: Parameter 2 to {closure}() expected to be a reference, value given in /home/####/public_html/wp-includes/plugin.php on line 525

    Changing &$email_obj to $email_obj worked for me. The following code works:

    add_action( 'bp_email', function( $email_type, $email_obj ) {
    	$email_obj->set_from( "custom@example.com", "Custom Website Name" );
    }, 10, 2 );

    Andrew
    Participant

    @sm60

    Ah thanks @shanebp. I use the followers plugin instead of using the friends component which is why it didn’t work.


    Andrew
    Participant

    @sm60

    Thanks @imaath And thanks for your involvement in the fantastic 2.4 release.


    Andrew
    Participant

    @sm60

    Just one quick thing. Is it possible to set this up so the default cover image works?

    $cover_image_url = bp_attachments_get_attachment( 'url', array( 'item_id' => bp_displayed_user_id() ) ); doesn’t work for the default cover image:

    function your_theme_xprofile_cover_image( $settings = array() ) {
            $settings['width']  = 1000;
            $settings['height'] = 333;
    	$settings['default_cover'] = 'http://mysite/link-to-default-coverimage.jpg';
     
        return $settings;
    }
    add_filter( 'bp_before_xprofile_cover_image_settings_parse_args', 'your_theme_xprofile_cover_image', 10, 1 );
    add_filter( 'bp_before_groups_cover_image_settings_parse_args', 'your_theme_xprofile_cover_image', 10, 1 );

    Andrew
    Participant

    @sm60

    Perfect. Just what I needed. Thanks @r-a-y.


    Andrew
    Participant

    @sm60

    I can set the size and default image from that article, but I’m still not sure how to display it in an img tag.

    With the WordPress header image, you can display the admin header image in an img tag:

    <img src="<?php header_image(); ?>" />

    Is there a Buddypress equivalent for the WordPress function header_image() ?
    https://codex.wordpress.org/Function_Reference/header_image


    Andrew
    Participant

    @sm60

    * I meant to say CSS background-image: url() instead of background_url.

    Is it possible to change this to an <img> tag instead? I just need to know what to put in the img src="" to display the member’s cover image.

    Thanks in advance.


    Andrew
    Participant

    @sm60

    It worked. Perfect. Thanks for your help 🙂

Viewing 8 replies - 1 through 8 (of 8 total)
Skip to toolbar