Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Add profile meta to activity item

@graeme_bryson

Participant

Read this to learn what the 1, 3 does.

Thanks for this, that’s actually cleared up a bit of misinformation I’ve had in the past.

I’m now using the following snippet if anyone needs it in the future. It may not be perfect in terms of logic, but it seems to be working well.

//* Add Job Title to activity
function job_title_activity_action( $action, $activity, $r) {

	$bp_job_title = bp_get_profile_field_data( 'field=Job Title&user_id=' . bp_get_activity_user_id());
	$job_title = '</a> <span class="job-title">' . $bp_job_title . '</span>';
	$action = str_replace( '</a>', $job_title, $action);

   return $action;

}
add_filter( 'bp_get_activity_action_pre_meta', 'job_title_activity_action', 1, 3 );

Thanks for your help @shanebp, I really appreciate it!

Cheers, Graeme

Skip to toolbar