Changeset 7812 for trunk/bp-xprofile/bp-xprofile-functions.php
- Timestamp:
- 02/06/2014 07:38:35 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-xprofile/bp-xprofile-functions.php
r7730 r7812 438 438 return false; 439 439 440 $fullname = xprofile_get_field_data( bp_xprofile_fullname_field_ name(), $user_id );440 $fullname = xprofile_get_field_data( bp_xprofile_fullname_field_id(), $user_id ); 441 441 $space = strpos( $fullname, ' ' ); 442 442 … … 474 474 return; 475 475 476 xprofile_set_field_data( bp_xprofile_fullname_field_ name(), $user->ID, $user->display_name );476 xprofile_set_field_data( bp_xprofile_fullname_field_id(), $user->ID, $user->display_name ); 477 477 } 478 478 add_action( 'user_profile_update_errors', 'xprofile_sync_bp_profile', 10, 3 ); … … 626 626 627 627 /** 628 * Return the field ID for the Full Name xprofile field. 629 * 630 * @since BuddyPress (2.0.0) 631 * 632 * @return int Field ID. 633 */ 634 function bp_xprofile_fullname_field_id() { 635 $id = wp_cache_get( 'fullname_field_id', 'bp_xprofile' ); 636 637 if ( false === $id ) { 638 global $wpdb; 639 640 $bp = buddypress(); 641 $id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_fields} WHERE name = %s", bp_xprofile_fullname_field_name() ) ); 642 643 wp_cache_set( 'fullname_field_id', $id, 'bp_xprofile' ); 644 } 645 646 return absint( $id ); 647 } 648 649 /** 628 650 * Return the field name for the Full Name xprofile field 629 651 *
Note: See TracChangeset
for help on using the changeset viewer.