BuddyDev

Documentation

This documentation applies to bp-wire 1.1.3 or above.

Toc:-

  • Slug Customization
  • Changing Labels
  • Enabling Group Wire
  • Changing Wire link Position In navigation menu
  • Post User wire message to activity stream
  • Set Wire as default landing page
  • Disabling profile wire
  • Disabling notification

Slug Customization:-

define("BP_WIRE_SLUG","wall");

Changing Labels:-


define("BP_WIRE_LABEL","Wall");//change it to anything

Enabling Group Wire:-

add_filter("is_group_wire_enabled","enable_group_wire");
function enable_group_wire(){
return true;
}

*Please Note, after enabling group wire, you must login to wordpress dashboard as administrator in order to get the tables created.

Change the Position of Wire in User profile navigation:-

define("BP_WIRE_POSITION",20);//change it to any integer value

Change The Group Wire navigation link position:-

define("BP_GROUP_WIRE_POSITION",20);//change it to any integer value


Post Wire message to activity stream(For user profile wire):-

add_filter("xprofile_new_wire_post","bp_wire_post_to_activity");

function bp_wire_post_to_activity($wire){
global $bp;
if(bp_is_home())
return;
    //post to activity
            $activity_action = sprintf( __( '%s wrote on the %s of  %s:', 'bp-wire'), bp_core_get_userlink( $bp->loggedin_user->id ), strtolower(BP_WIRE_LABEL), bp_core_get_userlink( $bp->displayed_user->id ) , bp_core_get_user_displayname($bp->displayed_user->id) . '</a>' );
		$activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $wire->content ) ) . '</blockquote>';

		xprofile_record_activity( array(
			'action' => apply_filters( 'profile_activity_new_wire_post', $activity_action ),
			'content' => apply_filters( 'profile_activity_new_wire_post', $activity_content ),
			'primary_link' => apply_filters( 'profile_activity_new_wire_post_primary_link', bp_core_get_userlink( $bp->displayed_user->id ) ),
			'type' => 'new_wire_post',
			'item_id' => $bp->displayed_user->id,
			'secondary_item_id' => $wire->id
		) );
}

Set Wire as the default landing page for User:-

 define("BP_DEFAULT_COMPONENT","wire");//"wire" is the slug of bp-wire, if you have changed the slug, please use the correct one here

Disable loading of css file from bp-wire plugin directory:-

add_filter("bp_wire_load_css","stop_autoloading_wire_css");

function stop_autoloading_wire_css(){

return false;

}