Hi Guys,

I'm trying to get an image to show instead of text in this button array

$button = array(
	'id'                => 'not_friends',
	'component'         => 'friends',
	'must_be_logged_in' => true,
	'block_self'        => true,
	'wrapper_class'     => 'friendship-button not_friends',
	'wrapper_id'        => 'friendship-button-' . $potential_friend_id,
	'link_class'        => '',
	'link_href'         => wp_nonce_url( $bp->loggedin_user->domain . $bp->friends->slug . '/add-friend/' . $potential_friend_id . '/', 'friends_add_friend' ),	'link_text'         => __( 'Follow', 'buddypress' ),
	'link_title'        => __( 'Follow', 'buddypress' ),
	'link_id'           => 'friend-' . $potential_friend_id,
	'link_rel'          => 'add',
	'link_class'        => 'add'
	'src'		    => 'http://www.pixelcove.co.uk/images/addcontact.png';
		);
break;

Obviously this is wrong, but does anyone have any idea how to get an image to show up?

Many Thanks

Chris

Member Avatar
diafol

THe above looked ok I suppose. It's the code that builds the button from the array that needs investigation.

THe above looked ok I suppose. It's the code that builds the button from the array that needs investigation.

This is code that builds the button (I think lol)

// Filter and return the HTML button
		return bp_get_button( apply_filters( 'bp_get_add_friend_button', $button ) );

An array holds data, it does not display anything.

As Ardav says, I suspect that the output of your <input> or <button> tag is what is causing the issue here.

Member Avatar
diafol

Show these functions: bp_get_button() and apply_filters();