Changeset 3260 for branches/1.2/bp-core/bp-core-templatetags.php
- Timestamp:
- 09/13/2010 01:08:31 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.2/bp-core/bp-core-templatetags.php
r3245 r3260 416 416 417 417 return apply_filters( 'bp_member_last_active', $registered ); 418 }419 420 function bp_member_add_friend_button() {421 global $members_template;422 423 if ( function_exists( 'bp_add_friend_button' ) ) {424 if ( null === $members_template->member->is_friend )425 $friend_status = 'not_friends';426 else427 $friend_status = ( 0 == $members_template->member->is_friend ) ? 'pending' : 'is_friend';428 429 echo bp_add_friend_button( $members_template->member->id, $friend_status );430 }431 }432 433 function bp_member_total_friend_count() {434 global $members_template;435 436 echo bp_get_member_total_friend_count();437 }438 function bp_get_member_total_friend_count() {439 global $members_template;440 441 if ( 1 == (int) $members_template->member->total_friend_count )442 return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friend', 'buddypress' ), (int) $members_template->member->total_friend_count ) );443 else444 return apply_filters( 'bp_get_member_total_friend_count', sprintf( __( '%d friends', 'buddypress' ), (int) $members_template->member->total_friend_count ) );445 418 } 446 419 … … 1100 1073 1101 1074 /** 1075 * bp_button( $button ) 1076 * 1077 * Creates and outputs a button. 1078 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text 1079 * 1080 * @param array $button 1081 */ 1082 function bp_button( $button = '' ) { 1083 echo bp_get_button( $button ); 1084 } 1085 /** 1086 * bp_get_button( $button ) 1087 * 1088 * Creates and returns a button. 1089 * Args: div_id | div_class | a_href | a_title | a_id | a_class | a_rel | a_text 1090 * 1091 * @param array $button 1092 * @return string 1093 */ 1094 function bp_get_button( $button = '' ) { 1095 $btn = new BP_Button( $button ); 1096 return apply_filters( 'bp_get_button', $btn->contents, $button ); 1097 } 1098 1099 /** 1102 1100 * bp_create_excerpt() 1103 1101 *
Note: See TracChangeset
for help on using the changeset viewer.