Ticket #5387: bp-members-template.php.patch
File bp-members-template.php.patch, 1.4 KB (added by , 11 years ago) |
---|
-
bp-members/bp-members-template.php
586 586 add_filter( 'bp_get_member_name', 'strip_tags' ); 587 587 add_filter( 'bp_get_member_name', 'esc_html' ); 588 588 589 function bp_member_last_active( ) {590 echo bp_get_member_last_active( );589 function bp_member_last_active( $args='' ) { 590 echo bp_get_member_last_active( $args ); 591 591 } 592 function bp_get_member_last_active( ) {592 function bp_get_member_last_active( $args='' ) { 593 593 global $members_template; 594 595 if ( isset( $members_template->member->last_activity ) ) 596 $last_activity = bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s', 'buddypress' ) ); 597 else 594 $defaults = array( 595 'view_active' => true 596 ); 597 $r = wp_parse_args( $args, $defaults ); 598 extract( $r ); 599 if ( isset( $members_template->member->last_activity ) ) { 600 $last_active = $members_template->member->last_activity; 601 // If view_active is true 602 if ( $view_active ) { 603 $last_activity = bp_core_get_last_activity( $last_active, __( 'active %s', 'buddypress' ) ); 604 } else { 605 $last_activity = bp_core_time_since( $last_active ); 606 } 607 } else { 598 608 $last_activity = __( 'Never active', 'buddypress' ); 599 609 } 600 610 return apply_filters( 'bp_member_last_active', $last_activity ); 601 611 } 602 612