Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/29/2014 05:01:17 PM (12 years ago)
Author:
johnjamesjacoby
Message:

First pass at introducing BuddyPress profile editing to /wp-admin:

  • New bp-members-admin.php and accompanying assets to handle the initial admin page creation (outside of XProfile).
  • New stats template functions in Blogs, Friends, and Groups components, to provide additional meta data about a members community involvement.
  • Modifies some existing XProfile admin/template/filters to make it more accommodating to querying for profile data outside of BuddyPress's traditional displayed_user context.
  • Props imath, boonebgorges, johnjamesjacoby. Fixes #5197.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-filters.php

    r6647 r7764  
    248248    global $bp, $wpdb;
    249249
    250     if ( bp_is_active( 'xprofile' ) ) {
    251         $fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) );
    252         $user_id_names     = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value as fullname FROM {$bp->profile->table_name_data} WHERE user_id IN ({$user_ids_sql}) AND field_id = %d", $fullname_field_id ) );
    253 
    254         // Loop through names and override each user's fullname
    255         foreach ( $user_id_names as $user ) {
    256             if ( isset( $user_query->results[ $user->user_id ] ) ) {
    257                 $user_query->results[ $user->user_id ]->fullname = $user->fullname;
    258             }
     250    if ( ! bp_is_active( 'xprofile' ) ) {
     251        return;
     252    }
     253
     254    $fullname_field_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) );
     255    $user_id_names     = $wpdb->get_results( $wpdb->prepare( "SELECT user_id, value as fullname FROM {$bp->profile->table_name_data} WHERE user_id IN ({$user_ids_sql}) AND field_id = %d", $fullname_field_id ) );
     256
     257    // Loop through names and override each user's fullname
     258    foreach ( $user_id_names as $user ) {
     259        if ( isset( $user_query->results[ $user->user_id ] ) ) {
     260            $user_query->results[ $user->user_id ]->fullname = $user->fullname;
    259261        }
    260262    }
Note: See TracChangeset for help on using the changeset viewer.