Changeset 8748
- Timestamp:
- 08/02/2014 02:31:13 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-members/bp-members-template.php
r8683 r8748 795 795 * @param array $args { 796 796 * Array of optional arguments. 797 * @type bool $active_format If true, formatted "Active 5 minutes 798 * ago". If false, formatted "5 minutes ago". Default: true. 797 * @type mixed $active_format If true, formatted "active 5 minutes 798 * ago". If false, formatted "5 minutes ago". If string, should 799 * be sprintf'able like 'last seen %s ago'. 799 800 * } 800 801 * @return string … … 803 804 global $members_template; 804 805 805 $r = wp_parse_args( $args, array( 806 'active_format' => true, 806 // Parse the activy format 807 $r = bp_parse_args( $args, array( 808 'active_format' => true 807 809 ) ); 808 810 811 // Backwards compatibilty for anyone forcing a 'true' active_format 812 if ( true === $r['active_format'] ) { 813 $r['active_format'] = __( 'active %s', 'buddypress' ); 814 } 815 816 // Member has logged in at least one time 809 817 if ( isset( $members_template->member->last_activity ) ) { 810 if ( ! empty( $r['active_format'] ) ) { 811 $last_activity = bp_core_get_last_activity( $members_template->member->last_activity, __( 'active %s', 'buddypress' ) ); 812 } else { 813 $last_activity = bp_core_time_since( $members_template->member->last_activity ); 814 } 818 819 // Backwards compatibility for pre 1.5 'ago' strings 820 $last_activity = ! empty( $r['active_format'] ) 821 ? bp_core_get_last_activity( $members_template->member->last_activity, $r['active_format'] ) 822 : bp_core_time_since( $members_template->member->last_activity ); 823 824 // Member has never logged in or been active 815 825 } else { 816 826 $last_activity = __( 'Never active', 'buddypress' ); 817 827 } 818 828 819 return apply_filters( 'bp_member_last_active', $last_activity ); 829 // Filter and return 830 return apply_filters( 'bp_member_last_active', $last_activity, $r ); 820 831 } 821 832
Note: See TracChangeset
for help on using the changeset viewer.