Skip to content

Instantly share code, notes, and snippets.

@ntwb
Created June 3, 2014 21:42
Show Gist options
  • Save ntwb/d9afe45af75c6d20fe75 to your computer and use it in GitHub Desktop.
Save ntwb/d9afe45af75c6d20fe75 to your computer and use it in GitHub Desktop.
bbPress - User Profile User Location
<?php
/*
Plugin Name: bbPress - User Profile User Location
Plugin URI: https://gist.github.com/ntwb/d9afe45af75c6d20fe75
Description: bbPress - User Profile User Location
Version: 0.1
Author: Stephen Edgar - Netweb
Author URI: http://netweb.com.au
*/
function ntwb_user_contact_methods_location( $user_contact ){
/* Add user contact methods */
$user_contact['location'] = __('Location');
return $user_contact;
}
add_filter('user_contactmethods', 'ntwb_user_contact_methods_location');
function ntwb_bbpress_user_profile_location() {
if ( bbp_get_displayed_user_field( 'location' ) ) : ?>
<div id="bbp-user-profile" class="bbp-user-profile">
<div class="bbp-user-section">
<p class="bbp-user-user-location">
<?php printf( __( 'Location: %s', 'bbpress' ), bbp_get_displayed_user_field( 'location' ) ); ?>
</p>
</div>
</div>
<?php endif;
}
add_action( 'bbp_template_after_user_profile', 'ntwb_bbpress_user_profile_location' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment