Skip to content

Instantly share code, notes, and snippets.

@ntwb
Created April 24, 2014 04:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ntwb/11241301 to your computer and use it in GitHub Desktop.
Save ntwb/11241301 to your computer and use it in GitHub Desktop.
Add a custom user profile field the bbPress user profile and replies author details
<?php
/*
Plugin Name: bbPress - CLB Add user school to reply author details
Plugin URI: https://gist.github.com/ntwb/11241301
Description: bbPress - CLB Add user school to reply author details
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
function clb_user_contact_methods( $user_contact ){
/* Add user contact methods */
$user_contact['school'] = __('School Name');
return $user_contact;
}
add_filter('user_contactmethods', 'clb_user_contact_methods');
function clb_school_replies_author() {
echo get_user_meta(bbp_get_reply_author_id(), 'school', true);
}
add_action( 'bbp_theme_after_reply_author_details', 'clb_school_replies_author' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment